[GRLUG] file backup script

Raymond McLaughlin driveray at ameritech.net
Tue Jul 17 18:04:57 EDT 2007


It looks like file names containing blank spaces would break this
script. I once wrote a script that worked around this problem by
referencing inode numbers. I'll see if I can dig it up. Still, if the
source files do not all reside on one filesystem... that means more work.


Bill Pribble wrote:
> forgot, you will have to zero out FILE on every loop
> 
> -----Original Message-----
> From: Bill Pribble
> Sent: Tue 7/17/2007 2:19 PM
> To: grlug at grlug.org
> Subject: RE: [GRLUG] file backup script
>  
> Here is a shot at it.
> 
> for i in $(cat file.txt)
> do
> unset FILE
> FILE=$(find /dir/to/start/search -name ${i})
> 
> if [ ${FILE} ] #if FILE is not empty
> then
> cp -p ${FILE} /local/dir #copy file from remote dir to local dir
> fi
> 
> done
> 
> Thanks
> Bill


More information about the grlug mailing list