Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Backup Script

Status
Not open for further replies.

Midrange

Vendor
Aug 28, 2002
135
SG
Hi there, can any one can give me one of your sample script for data daily backup? or any website i can visit to get a sample script?
 
#!/bin/ksh
#Wow!

#If you can view Tek-tips, you should be able to view this URL. oh, well;
#Here's one of my backup scripts: I like to back up my source code only,
#eliminating any object files: (If you run from cron, make sure your $PATH is set in
# the script.

DIR="usr/tgg usr/ycc" #directories to backup, space-delimited
DEVICE="/tmp/cpio.lst"
OUTPUT="/tmp/output.list"

# back up usr/tgg & usr/sfc directory and
# skip any files named errlog, tags and extensions with 4go, o, frm
find $DIR -type f ! \( -name '*.4go' -o -name '*.o' -o -name '*.frm' -o -name tags -o -name 'errlog' \) -print |tee $OUTPUT| cpio -ocvdum > $DEVICE

# create a list of all files in output.list and create a cpio archive
# in /tmp/cpio.lst. Again, use at your risk.

# Regards,

# Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top