Can I say:
MYPATH=/root/scripts
MYSCRIPT=doit.sh
0 1 * * * $MYPATH/$MYSCRIPT
in crontab -e ?
Is it possible to use variables in crontab -e ?
|
feedback
|
|
Yes, you can define and use variables in this way. There's a limitation (which you haven't hit in your examples): the string on the right of the This is stated in the documentation, which you can see by running
(Note that | |||
|
feedback
|
|
Just made a try, yes it's possible. You can figure it out with this simple example, put this in your FOO=qwerty * * * * * echo $FOO > ~/out And check the file | |||||
feedback
|
|
No you can't a cronjob can only contain cron items. Is it not an option to create a bash-script and run the bash-script via a cronjob? | |||
feedback
|