[lug] cron and date command

Tony Dyson anorak at comcast.net
Wed Mar 8 21:51:21 MST 2006


I've used bdt=`date "+%Y%m%d%H%M%S"` in a bash script to get a date + 
time-stamp variable to use in creating a backup directory.

I'd echo the suggestion to create a script & reference that in your crontab.

Gordon Golding wrote:
> If I use `date +%y%m%d` it works fine from the command line.  But I run the same command in cron and it doesn't run - it doesn't create the log or err files or run the script.




More information about the LUG mailing list