Re: bash script query - echo date

2006-02-05 Thread Robert Himmelmann
Steve Holdoway wrote: [...]or set a workable $PATH up for the duration of the script. Steve It might be enough to source /etc/profile: . /etc/profile Happy Hacking, Robert J. C. Himmelmann

Re: bash script query - echo date

2006-02-05 Thread Dave G
thanks for the replies, they got me thinking about $PATH so I did a bit more digging and low and behold I had the following line in my script: "unset PATH # suggestion from H. Milz: avoid accidental use of $PATH" I commented out the "unset PATH" and the date output printed in my logfile f

Re: bash script query - echo date

2006-02-04 Thread Steve Holdoway
Don't forget ( to expand on Volkers note ) that if you're running from cron, then you have no environment set up. You either need to explicitly define every program by absolute path ( which is what I do - but it's only a matter of style... arguably more secure? ), or set a workable $PATH up for

Re: bash script query - echo date

2006-02-04 Thread Volker Kuhlmann
> That script should work though. > echo "Daily Backup Successful: $(/usr/bin/date)" Ah yes, because date by itself is an executable program. The variable definitions at the start suggested the intention was to use $($DATE). The fact that date didn't run means "date" found, which in turn means th

Re: bash script query - echo date

2006-02-04 Thread Robert Himmelmann
Volker Kuhlmann wrote: bash names are case-sensitive. Volker That script should work though. Maybe it is a good idea to try the full path i.e.: echo "Daily Backup Successful: $(/usr/bin/date)" >> /home/dave/.daves_backup.log Otherwise I see no reason why it does not run. Happy Hacking, R

Re: bash script query - echo date

2006-02-04 Thread Jamie Dobbs
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 t

Re: bash script query - echo date

2006-02-04 Thread Volker Kuhlmann
bash names are case-sensitive. Volker -- Volker Kuhlmann is possibly list0570 with the domain in header http://volker.dnsalias.net/ Please do not CC list postings to me.

bash script query - echo date

2006-02-04 Thread Dave G
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