![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Full System Backup Sco 5.0.5 | nellenodrog | UNIX for Dummies Questions & Answers | 2 | 01-23-2009 12:22 PM |
| full system backup | mm00123 | SUN Solaris | 1 | 04-17-2008 02:30 AM |
| Full backup and Restore | Basha | SUN Solaris | 16 | 01-08-2008 07:39 PM |
| System full backup to tape | Tlg13team | UNIX for Dummies Questions & Answers | 0 | 12-20-2007 04:43 AM |
| Full System Backup / Cloning HPUX | real-chess | UNIX for Dummies Questions & Answers | 0 | 08-12-2006 09:26 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
full system backup script
Please help. I am new to linux. I wrote a script to run the backup on lunix machine but the job gave me an error. I am using Linux 2.6.14.3. Below is the sample of my script can anyone tell me where went wrong? Thanks in advance.
#!/bin/sh dat=$(date +%d%b%y) logdir="/usr/local/scripts/log/backup" backuptarget="/*" backupdir="/usr/hell/backups" for HOST in devil1 devil2 devil3 do ssh $HOST "tar -zcvpf $backupdir/$HOST.$dat.tgz $backuptarget --exclude "/usr/hell/DB" >> $backupdir/$HOST.backup.log.$dat " ssh $HOST "cat $backupdir/$HOST.backup.log.$dat" >> $logdir/"$HOST.backup.log.$dat" gzip $logdir/"$HOST.backup.log.$dat" scp root@$HOST:$backupdir/$HOST.$dat.tgz $backupdir # scp exits with 0 on success or >0 if an error occurred. if [ $? -gt 0 ]; then /var/netpage OPERATIONS -TSMS -G10.200.1.99 "$HOST scp failed" fi /bin/tar ztvf $backupdir/$HOST.$dat.tgz ||/var/netpage OPERATIONS -TSMS -G10.201.2.66 "$HOST.$dat.tgz is no good" ssh $HOST "rm -f $backupdir/*" done /bin/tar -zcvpf $backupdir/devil1.$dat.tgz /* --exclude "/usr/hell/backups/*" --exclude "/usr/hell/DB/*" --exclude "/usr/dragon/.cache/*" >> $logdir/"devil1.backup.log.$dat" gzip $logdir/"devil1.backup.log.$dat" /bin/tar ztvf $backupdir/devil1.$dat.tgz ||/var/netpage OPERATIONS -TSMS -G10.200.1.99 "devil1.$dat.tgz is no good" #zip up /usr/hell/backups directory as windows bkf file is big gzip $backupdir/* /bin/tar -rvpf /dev/st0 $backupdir/* /usr/hell/DB/200[4-6]*/* --exclude "*log*" >> $logdir/"tape.backup.log.$dat" /bin/gzip $logdir/"tape.backup.log.$dat" rm -f $backupdir/* |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|