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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date

Status
Not open for further replies.

copperslim

Technical User
Dec 13, 2002
101
GB
Has anybody got a script when run will display date and time of the previous?

Backup emails me with the log file for the overnight backup which finishes any time part midnight, log file is stored at
/logs/tape_backup.$(date +%d%m%y).log[/blue]


It is then emailed to me as

Overnight backup for $hostname
Status : BACKUP SUCCESSFUL
Full output can be found in /logs/tape_backup.$(date +%d%m%y).log


How do I get the mail to change the Overnight to the date it run. Ie

020903 backup for $hostname
Status : BACKUP SUCCESSFUL
Full output can be found in /logs/tape_backup.$(date +%d%m%y).log


I want to change Overnight to the day backup run.

 

Add the following to your backup script before backup execution s:

RUNDATE=$(date +%d%m%y)

And while sending the e-mail do:

mail -s "$RUNDATE backup for $hostname" ....



----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top