[GRLUG] file backup script

Bill Pribble Bill.Pribble at Haworth.com
Tue Jul 17 14:21:16 EDT 2007


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


-----Original Message-----
From: grlug-bounces at grlug.org on behalf of Nathan Drier
Sent: Tue 7/17/2007 1:58 PM
To: grlug at grlug.org
Subject: [GRLUG] file backup script
 
Ive been battling with this all day,  so I thought id ask the list for any
ideas:

I have a text list of about 17,000 files that I need to consolidate into one
folder.  All these files are spread through a folder structure on a mapped
drive.  I need to write a script that will read the filenames from the text
file,  then search recursively through the mapped drive for them.  If the
file exists somewhere on the mapped drive,  I need it to be copied to a
local folder where I can run them all through a converter.  Any ideas?




More information about the grlug mailing list