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 CENTOS
arp2ethers
ARP2ETHERS(8) System Manager's Manual ARP2ETHERS(8)
NAME
arp2ethers - convert arpwatch address database to ethers file format
SYNOPSIS
arp2ethers
DESCRIPTION
arp2ethers converts file arp.dat in the current directory into ethers(5) format on stdout. Usually arp.dat is an ethernet/ip database file
generated by arpwatch(8). The arpwatch daemon in Debian will create different arp.dat depending on its configuration. All of them will be
available at /var/lib/arpwatch/.
FILES
/var/lib/arpwatch - default directory for arp.dat
arp.dat - ethernet/ip address database
SEE ALSO
arpwatch(8), ethers(5), rarp(8), arp(8),
BUGS
Please send bug reports to arpwatch@ee.lbl.gov.
AUTHORS
Original version by Craig Leres of the Lawrence Berkeley National Laboratory Network Research Group, University of California, Berkeley,
CA.
Modified for the Debian Project by Peter Kelemen, with additions from Erik Warmelink.
The current version is available via anonymous ftp:
ftp://ftp.ee.lbl.gov/arpwatch.tar.gz
This manual page was contributed by Hugo Graumann.
ARP2ETHERS(8)