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!

Cron backups

Status
Not open for further replies.

brendankarl

Technical User
May 30, 2003
9
GB
Hi,

Basically I am looking to implement a cron backup using the tar command..but I need to know if there is any way that I can automatically find out if the previous nights backups has worked (printout for example).

Is there any quick script that I could put together to do this.

The tar command that I am using is:- tar cvf /dev/rmt0 /usr /bespoke

Any help would be greatly appreciated
 
Put something like this in a script and run it from cron:
Code:
#!/usr/bin/ksh

tar -cvf /dev/rmt0 /usr /bespoke
success=$?
#Anything but 0 means failure
if [ $success -ne 0 ]
  then
    echo "Backup failed"
  else
  echo "Backup successfull"
fi

or
echo "Backup failed" | mail -s "Daily Backups" me@somewhere.com
or
echo "Backup failed" | lp -dprintername
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top