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. -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Wesley Skoczen http://portal.skoczen.com Linux Registered User #274645 at http://counter.li.org/ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
On Tue, 01 Jul 2003 13:15:15 -0400
Wesley Skoczen
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
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
On Tuesday 01 July 2003 19:15, 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. | -- try a search on konserve (a small kde backup application) Fab
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 01 July 2003 12:15, 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. -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Wesley Skoczen http://portal.skoczen.com Linux Registered User #274645 at http://counter.li.org/ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SuSE uses the following scripts: /usr/lib/YaST2/bin/backup_archive.pl /usr/lib/YaST2/bin/backup_search.pl Descriptions are located within the scripts. backup_search.pl "feeds" into backup_archive.pl. I like them very much. HTH. - -- Thomas Jones Linux-Howtos Network Administrator OpenGPG Key: 0x6A3DF6E9 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQE/AeosQT2komo99ukRAoYeAKDhyG4KDfYsO3AhchtQP+rQEKiI9wCgmPDF jLW+x1BprXSLdAzI0HvJQTY= =RGFI -----END PGP SIGNATURE-----
The 03.07.01 at 15:08, Thomas Jones wrote:
SuSE uses the following scripts:
/usr/lib/YaST2/bin/backup_archive.pl /usr/lib/YaST2/bin/backup_search.pl
Interesting...
Descriptions are located within the scripts. backup_search.pl "feeds" into backup_archive.pl.
I like them very much. HTH.
Do you know if it is possible to make Yast backup remember it's configuration from one run to the next? A configuration file, perhaps? Or do I need to hardcode it? I have a long list of directories I do not want to backup, and it is a real nuisance that yast doesn't remember them. -- Cheers, Carlos Robinson
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 01 July 2003 18:34, Carlos E. R. wrote:
The 03.07.01 at 15:08, Thomas Jones wrote:
SuSE uses the following scripts:
/usr/lib/YaST2/bin/backup_archive.pl /usr/lib/YaST2/bin/backup_search.pl
Interesting...
Descriptions are located within the scripts. backup_search.pl "feeds" into backup_archive.pl.
I like them very much. HTH.
Do you know if it is possible to make Yast backup remember it's configuration from one run to the next? A configuration file, perhaps? Or do I need to hardcode it?
I have a long list of directories I do not want to backup, and it is a real nuisance that yast doesn't remember them.
-- Cheers, Carlos Robinson
I'm really not sure........i have never tried that scenario. I usually just let the script do it's thing. I started making a "snapshot" script. Essentially, it acquired as much "vital" information as possible upon a reboot, failure, etc....... And these scripts were called from it. Interesting idea though. Given that it already is fed from the other script, it should be fairly easy to call upon a "listing" or configuration file from say: /var/adm/backup/backup_weekly.conf Let me know how it works. ;) - -- Thomas Jones Linux-Howtos Network Administrator OpenGPG Key: 0x6A3DF6E9 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQE/AihHQT2komo99ukRAlMoAKCncqqW5V0gH6mN+XANlutDzDGDgwCgyXE0 S55Aoa/YwY/sQqlwZDl9CZc= =JA3d -----END PGP SIGNATURE-----
Thank You all for help I like konserve for small hourly backups of current work. But script I will use is that one from Jim Morton - it does what I need - thank you Jim, I modified it sligtly to make it silently work with crontab. Attached bellow: #!/bin/bash # # creates backups of mysql and selected directories # # enter the line below into crontab to run this script daily # 45 03 * * * root /root/backup.sh # ####### C O N F I G U R A T I O N ########## DATA="/home /root /srv /usr/local/bin /var/spool/imap" CONFIG="/etc /var/lib /var/named" # leave empty("") if you don't need to mount it: BACKUP_PARTITION="/scratchspace" BACKUP_DEST="/scratchspace/backup" # three letters entry: "Mon", "Tue" ..... BACKUP_DAY="Tue" # repleace "backup.log" with "/dev/null" if you don't need log file: LOG_FILE="/var/log/backup.log" LIST="/tmp/backlist_$$.txt" ####### P R O G R A M L O G I C ########## MOUNT="" # set $(date) # # mark the time of this backup date >> $LOG_FILE if !(test "$BACKUP_PARTITION" = ""); then if `mount $BACKUP_PARTITION 2>> $LOG_FILE` ; then MOUNT="succes" 2>> $LOG_FILE # mounted without problems else MOUNT="failure" 2>> $LOG_FILE # possibly already mounted fi fi if !(test -d $BACKUP_DEST/data); then mkdir $BACKUP_DEST/data 2>> $LOG_FILE fi if !(test -d $BACKUP_DEST/config); then mkdir $BACKUP_DEST/config 2>> $LOG_FILE fi if !(test -d $BACKUP_DEST/database); then mkdir $BACKUP_DEST/database 2>> $LOG_FILE fi if test "$1" = "$BACKUP_DAY" ; then # weekly a full backup of all data and config. settings: # rm -f $BACKUP_DEST/data/data_full* tar cfz "$BACKUP_DEST/data/data_full_$6-$2-$3.tgz" $DATA 2>> $LOG_FILE # rm -f $BACKUP_DEST/config/config_full* tar cfz "$BACKUP_DEST/config/config_full_$6-$2-$3.tgz" $CONFIG 2>> $LOG_FILE else # incremental backup: # find $DATA -depth -type f \( -ctime -1 -o -mtime -1 \) -print > $LIST tar cfzT "$BACKUP_DEST/data/data_diff_$6-$2-$3.tgz" "$LIST" 2>> $LOG_FILE rm -f "$LIST" # find $CONFIG -depth -type f \( -ctime -1 -o -mtime -1 \) -print > $LIST tar cfzT "$BACKUP_DEST/config/config_diff_$6-$2-$3.tgz" "$LIST" 2>> $LOG_FILE rm -f "$LIST" fi # # create sql dump of databases: mysqldump -u root --password=xxxx --all-databases > "$BACKUP_DEST/database/databases_$6-$2-$3.sql" 2>> $LOG_FILE gzip -f "$BACKUP_DEST/database/databases_$6-$2-$3.sql" # # umount only if partition was mounted by this script if test "$MOUNT" = "succes"; then umount $BACKUP_PARTITION 2>> $LOG_FILE fi -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Wesley Skoczen http://portal.skoczen.com Linux Registered User #274645 at http://counter.li.org/ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The 03.07.01 at 19:33, Thomas Jones wrote:
Do you know if it is possible to make Yast backup remember it's configuration from one run to the next? A configuration file, perhaps? Or do I need to hardcode it?
I have a long list of directories I do not want to backup, and it is a real nuisance that yast doesn't remember them.
I'm really not sure........i have never tried that scenario. I usually just let the script do it's thing.
If I do, and I select "Search files which do not belog to any package" Yast will backup even the directory where I save this and other backups. Also, I'm not interested in yast saving copies of the updates rpms, my downloaded files, compiled sources, etc, because these, being already compressed, I backup separately to CD. Also, the resulting backup would be so big that Yast runs out of temporary space (/tmp) and crashes. Notice that I use (try to) Yast to do the backup, I have never used those two scripts independently. Probably I'll have to write my own script that calls them, and use a bunch of "--exclude-dir"
Interesting idea though. Given that it already is fed from the other script, it should be fairly easy to call upon a "listing" or configuration file from say:
/var/adm/backup/backup_weekly.conf
Let me know how it works. ;)
I'll try :-) -- Cheers, Carlos Robinson
The 03.07.01 at 15:08, Thomas Jones wrote:
SuSE uses the following scripts:
/usr/lib/YaST2/bin/backup_archive.pl /usr/lib/YaST2/bin/backup_search.pl
Descriptions are located within the scripts. backup_search.pl "feeds" into backup_archive.pl.
Ihave just found that they are in fact documented by suse; in directory "/usr/share/doc/packages/yast2-backup/" there is a "YaST2-backup-mini-HOWTO.html" and a "backup_specification.html". Still, the docs lacks examples. There some yast modules documented there; much of it is of "autodocs" type, but some (like backup) seems to have been wrote to be read ;-) It deserves to be printed on the manual. -- Cheers, Carlos Robinson
The 03.07.01 at 15:08, Thomas Jones wrote:
SuSE uses the following scripts:
/usr/lib/YaST2/bin/backup_archive.pl /usr/lib/YaST2/bin/backup_search.pl
Descriptions are located within the scripts. backup_search.pl "feeds" into backup_archive.pl.
I have just tried it, but it failed. I get this kind of output: nimrodel:~ # time yast_backup b Storing hostname: Success Storing date: Success Storing partition table Partition tables info read Stored partition: hda Stored partition: hdb Storing list of installed packages Packages stored: Success Creating archive: Unknown text in input file: Reading installed packages Unknown text in input file: Packages: 1205 Unknown text in input file: Size: 27 /etc/issue.net Unknown text in input file: Size: 3515 /usr/X11R6/lib/X11/fonts/Type1/encodings.dir Unknown text in input file: Size: 3515 /usr/X11R6/lib/X11/fonts/truetype/encodings.dir Unknown text in input file: Size: 13893 /usr/X11R6/lib/X11/fonts/truetype/fonts.dir ...and continues for every file listed, not a single one is accepted. What parameters do you feed to backup_search.pl? I have used: /usr/lib/YaST2/bin/backup_search.pl --output-default --search \ --exclude-dir /tmp --exclude-dir /var/lock --exclude-dir /var/run \ --exclude-dir /var/tmp --exclude-dir /var/cache \ --exclude-dir /backup \ ... --exclude-dir /usr/local/update \ --exclude-dir /srv/ftp/pub/suseupdate \ --exclude-dir /var/lib/YaST2/you/i386/update \ --exclude-fs devpts --exclude-fs proc --exclude-fs rootfs --exclude-fs shm \ --exclude-fs usbdevfs --exclude-fs vfat \ | tee YastBackupList It seems that the output file "YastBackupList" I created is not what "backup_archive.pl" is expecting. -- Cheers, Carlos Robinson
participants (6)
-
Carlos E. R.
-
Fabrice Mous
-
jrn@oregonhanggliding.com
-
Thomas Jones
-
Wesley Skoczen
-
zentara