11-17-2007
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/*
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am new to UNIX and need help in cloning a HPUX 10.2 Ace 5, can anybody please guide me in making a full system backup.
Real Chess (0 Replies)
Discussion started by: real-chess
0 Replies
2. UNIX for Dummies Questions & Answers
hi,
Recently, I had receive one system. it's run on the unix tru64 server.
I looking some log files when i know don't work few months age system backup to tape.
Below error:
INFO:Tape backups to tape tape0 starting
for backup list:
slot2:/disk4
Backup Command Variable... (0 Replies)
Discussion started by: Tlg13team
0 Replies
3. Solaris
I have unix server with OS 5.8 ,,,
I tried ufsdump 0ua -f /dev/rmt/0 / to perform full system backup on tape but I failed could any one give a procedure for full system backup on solaris machine using tapes??? (1 Reply)
Discussion started by: mm00123
1 Replies
4. UNIX for Dummies Questions & Answers
I would like to know if I can do a full system back
up on my Unix Sco openserver 5.0.5 Machine. If so, What
is the syntax to do this or where can I find this
information at?
Also, is it possible to make this tape bootable so
that I can easily do a full system restore? Any
information on... (2 Replies)
Discussion started by: nellenodrog
2 Replies
5. HP-UX
Hello,
I'm still new in HP-UX backup and I want to do a FULL BACKUP of HP-UX server to TAPE device. After reading on several forums and posts, i have list down several steps on how to do a full backup on HP-UX with fbackup. I would like the gurus here to comment/advise on the steps below
1)... (4 Replies)
Discussion started by: miskin
4 Replies
6. UNIX for Advanced & Expert Users
Hi,
In order to have a sand box machine that I could use to test some system changes before going to production state, I'd like to duplicate a working system to a virtual one. Ideally, I'd like to manage to do it this way :
- Make a full system backup excluding the user file system (this... (7 Replies)
Discussion started by: pagaille
7 Replies
7. UNIX for Advanced & Expert Users
Hi All,
I have successfully backup & restore (using tar) one of my Debian Lenny Servers.
On the restore server (standby machine), everytime i have to erase the disk & extract the tar backup.
I want to extract the tar on the running restore server on a directory for e.g /systembackup-01,... (11 Replies)
Discussion started by: coolatt
11 Replies
8. Shell Programming and Scripting
Hello All,
I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60%
Need to identify the unique file system that reaches threshold value.
ex:
capacity
... (4 Replies)
Discussion started by: sasikanthdba
4 Replies
9. Solaris
Hello i am new on Solaris, and i need to migrate my old AIX 5.3 to Solaris 11.2
Now i have all apps working fine but i have the backup cause i was reading and i have not idea about what method must i choose.
Btw on AIX i had a mksysb backup to restore all system and obviously another backups to... (4 Replies)
Discussion started by: thorin666
4 Replies
LEARN ABOUT NETBSD
virecover
VIRECOVER(8) BSD System Manager's Manual VIRECOVER(8)
NAME
virecover -- report recovered vi edit sessions
SYNOPSIS
/usr/libexec/virecover
DESCRIPTION
The virecover utility sends emails to users who have vi(1) recovery files.
This email gives the name of the file that was saved for recovery and instructions for recovering most, if not all, of the changes to the
file. This is done by using the -r option with vi(1). See the -r option in vi(1) for details.
If the backup files have the execute bit set or are zero length, then they have not been modified, so virecover deletes them to clean up.
virecover also removes recovery files that are corrupted, zero length, or do not have a corresponding backup file.
virecover is normally run automatically at boot time using /etc/rc.d/virecover.
FILES
/var/tmp/vi.recover/recover.* vi(1) recovery files
/var/tmp/vi.recover/vi.* vi(1) editor backup files
SEE ALSO
vi(1), rc.conf(5)
HISTORY
This script, previously known as recover.script, is from nvi and was added to NetBSD in 1996. It was renamed in 2001.
AUTHORS
This man page was written by Jeremy C. Reed <reed@reedmedia.net>.
BSD
October 9, 2006 BSD