File backup question


Subject: File backup question
From: Bob Crosby (bob@estimations.com)
Date: Wed Feb 04 2004 - 16:47:03 AKST


 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.



This archive was generated by hypermail 2a23 : Wed Feb 04 2004 - 16:48:05 AKST