KenCunningham
Technical User
Hi. I'm trying to figure out a method of passing today's date as a parameter to a script run through cron. I've tried the following command:
'<path_to_script> -u <param1> -p <param2> -d '`date +%d-%b-%y | tr -s '[:lower:]' '[:upper:]'`
Ignore param1 and param2, these seem to work, but the -d date parameter doesn't evaluate to today's date. As you can see, I am attempting to append the date command to the end of the command string, but cron doesn't appear to like it. I have also tried using /usr/bin/date rather than date alone, to no effect.
Any ideas gratefully received.
'<path_to_script> -u <param1> -p <param2> -d '`date +%d-%b-%y | tr -s '[:lower:]' '[:upper:]'`
Ignore param1 and param2, these seem to work, but the -d date parameter doesn't evaluate to today's date. As you can see, I am attempting to append the date command to the end of the command string, but cron doesn't appear to like it. I have also tried using /usr/bin/date rather than date alone, to no effect.
Any ideas gratefully received.