Job option default value as a bash command?

617 views
Skip to first unread message

Adrian Cardenas

unread,
Aug 25, 2015, 1:44:22 PM8/25/15
to rundeck-discuss
We have a job definition that is a bash command that takes a date as a required argument. We would like to set a default value for the option to be the current day's date. In bash I would normally run that as $(date +'%m/%d/%Y'), but since options are quoted, our shell command is receiving the string literal "$(date +'%m/%d/%Y')" instead of the current server date. Any suggestions on how to go about getting a default date time?

Thank you

Regards,
Adrian

Greg Schueler

unread,
Aug 25, 2015, 2:18:34 PM8/25/15
to rundeck...@googlegroups.com
Rundeck supports using an option value like "${DATE:format}", and will substitute the date/timestamp when evaluated


e.g. for your case: ${DATE:MM/dd/yyyy}

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/ba2b7a78-2150-451e-9f66-6f1c32ed841c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hao Dang

unread,
Feb 25, 2016, 8:17:30 PM2/25/16
to rundeck-discuss
weird thing is that this works if the job was triggered through the web ui.
but if the job is run by the scheduler, the literal ${DATE:MM/dd/yyyy} was passed to my program without having been interpreted as the date.
any ideas?
Reply all
Reply to author
Forward
0 new messages