Here is a script that I find useful for doing backups of selected directories.. #!/bin/bash # # creates backups of essential files # DATA="/home /root /srv /usr/local/bin /var/spool/imap" CONFIG="/etc /var/lib /var/named" LIST="/tmp/backlist_$$.txt" # set $(date) # mount /scratchspace if test "$1" = "Sun" ; then # weekly a full backup of all data and config. settings: # rm -f /scratchspace/backup/data/data_full* tar cfz "/scratchspace/backup/data/data_full_$6-$2-$3.tgz" $DATA # rm -f /scratchspace/backup/config/config_full* tar cfz "/scratchspace/backup/config/config_full_$6-$2-$3.tgz" $CONFIG else # incremental backup: # find $DATA -depth -type f \( -ctime -1 -o -mtime -1 \) -print > $LIST tar cfzT "/scratchspace/backup/data/data_diff_$6-$2-$3.tgz" "$LIST" rm -f "$LIST" # find $CONFIG -depth -type f \( -ctime -1 -o -mtime -1 \) -print > $LIST tar cfzT "/scratchspace/backup/config/config_diff_$6-$2-$3.tgz" "$LIST" rm -f "$LIST" fi # # create sql dump of databases: mysqldump -u root --password=xxxx --all-databases > "/scratchspace/backup/d atabase/databases_$6-$2-$3.sql" gzip "/scratchspace/backup/database/databases_$6-$2-$3.sql" # umount /scratchspace
On Tue, 01 Jul 2003 13:15:15 -0400 Wesley Skoczen
wrote: Hello Looking for small script to backup a few selected directories. Search at freashmeat lists 212 projects. I know there is backup program in YaST, but it is for the whole system backup, isn't it? Please tell me what you are using for your SuSE backup. Thank You.
For just a few directories, why not just tar them up? tar -zcvf somedir.tgz /somedir
if you want incrementals, try dar on freshmeat
rsync is used by alot of people too, it synchronizes directories, which can be a form of backup.
-- use Perl; #powerful programmable prestidigitation
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com