Re: File backup question


Subject: Re: File backup question
captgoodnight@acsalaska.net
Date: Wed Feb 04 2004 - 20:39:05 AKST


Ideas;

cd to directory
tree -afi | sed '/directory,/d' | sort -d | cut -c 3- >list
#sed '/directory,/d' could be sed '/directories,/d' depending

while read line
 do
locate $line
done <list

There are a few problems though,

It's not super fast (maybe make a seperate db?)
if filenames have numbers in them (seems maybe your files are uppercase only?)
locate tends to find EVERYTHING even close to $line, so grep what paths ya
want.
not sure on links?
maybe find instead?

good luck, please let me know what ya use, thanks

bests,
eddie

-- 
ICQ# 294477332
Where ravens sleep
No object can stop the driving rain
In wind, the smallest object can be deadly
Face the sun, to not see the shadows
Linux

On Wednesday 04 February 2004 04:47 pm, Bob Crosby wrote: > I'm trying to make a simple backup system, to do nightly backups to a > removable hard drive. What I have in mind is to run a cron job that will > write a set of tar files to this drive. > > I have about 10GB of data to back up, but I'd like to make each tar file no > bigger than about 1-2GB in size. The data is contained in about 70 > directories, of widely varying size. What I'd like to do is to break down > thefiles alphabetically so that the all files in folders with names > starting with, say, letters A-D go into the first tar file, E-H go into the > next one, I-L into the next, and so on. > > I see that the tar command will take input from a file (with the T option), > so I've been trying to use find, sed and/or awk to build the file -- and, > as newbie as I am with them, not getting very far. So far, I've got the > following two lines. The first one prints just the filename (without the > path) to 'outfile' > > ls -l /home/jobs/active-jobs/ | awk '{print $9}' >outfile > > And this one takes the input from 'outfile' and sends only files starting > with letters A-D to newoutfile. > > awk '/^[A-D]+/{print $0}' outfile >newoutfile > > Now I want to concatenate the pathname 'home/jobs/active-jobs' to each line > of newoutfile, to produce the file that tar can take as input. > > Can anyone tell me how to concatenate path and filename? > > (Or maybe make some better suggestions than the whole approach I'm > taking...?) > > Thanks in advance. > --------- > To unsubscribe, send email to <aklug-request@aklug.org> > with 'unsubscribe' in the message body.

--------- To unsubscribe, send email to <aklug-request@aklug.org> with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Wed Feb 04 2004 - 20:39:10 AKST