Hi, 

I usually use below script to backup every directory, which are under
SOURCE DIRECTORY, in a tar.gz format and store them in my backup
directory.

---------------------------------------
BACKUP_DIRECTORY=<Your backup directory>
SOURCE_DIRECTORY=<Your source directory>

cd $SOURCE_DIRECTORY
for i in * ; do tar cvfz "$BACKUP_DIRECTORY/$i.tgz" $i ;done
----------------------------------------



Hope this helps.

Cheers,
Carlo Feliciano N. Aureus
Information and Communication Technology Center
Ateneo de Naga University
4400 Naga City Philippines
(+63 54) 4726810


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Steve Buehler
Sent: Friday, March 28, 2003 9:06 AM
To: [EMAIL PROTECTED]
Subject: backup script

RedHat Linux 7.3
I am trying to create a backup script (/bin/sh type) that would read the

directories and create a seperate backup file for each directory.  I can

easily get the directories into a text file with "ls -d *".  How can I
run 
through that script one line at a time putting the contents of the line 
into a variable, then do something with it?

foreach line in file{
        $variable="line contents"
        run some commands that need $variable contents
}

Thank You in advance for any help.

Steve



-- 
This message has been scanned for viruses and
dangerous content by the MailScanner at ow5, and is
believed to be clean.



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to