try the line:
echo Daily Backup Successful: `date` >> /home/dave/.daves_backup.log
the ` (back-ticks) not ' (single quotes) are very important, I have
several scripts that use this kind of output and they work fine when
using a line like the one above
HTH
Jamie
Dave G wrote:
Hi all
I'm trying to print the completion of a simple RSYNC backup script to
a log file
eg. "Daily Backup Successful: Sun Feb 5 09:03:00 NZDT 2006"
The following line works of OK if I execute it manually or if I run it
as a seperate script with: "/usr/local/sbin/daily_snapshot_log"
but in the backup script it only prints "Daily Backup Successful: "
and won't include the date stamp
I've tried $ECHO & $DATE varitions etc. prior to posting
I assume its syntax but I can't figure out what the prolem is and have
had no luck with the man pages
>>>excerpt>>>
#!/bin/bash
# -------------------------------------------------------------------
# dave's filesystem-snapshot utility, as used on ubuntu1
#
# ------------- system commands used by this script --------------------
MOUNT=/bin/mount;
UMOUNT=/bin/umount;
CHOWN=/bin/chown;
CHGRP=/bin/chgrp;
CHMOD=/bin/chmod;
ECHO=/bin/echo;
RSYNC=/usr/bin/rsync;
DATE=/bin/date;
...(a whole lot of RSYNC stuff).....then ....
echo "Daily Backup Successful: $(date)" >> /home/dave/.daves_backup.log
exit 0