blanchet
Guru
- Joined
- Apr 17, 2018
- Messages
- 516
Hi,
I would like to use the TrueNAS Scale CLI to create a cron job but I do not understand yet how to create a dictionary for the schedule.
For example, I would like to stop the SSH service at midnight
If I use an empty schedule, it creates a hourly job
But if I try to specify another schedule on the command line it always fails with Expected end of text, found 's'
How can I specify the schedule dictionary?
I would like to use the TrueNAS Scale CLI to create a cron job but I do not understand yet how to create a dictionary for the schedule.
For example, I would like to stop the SSH service at midnight
If I use an empty schedule, it creates a hourly job
Code:
task cron_job create description="stop ssh" enabled=true command="/usr/bin/systemctl stop ssh" user=root schedule={}
But if I try to specify another schedule on the command line it always fails with Expected end of text, found 's'
Code:
task cron_job create description="stop ssh" enabled=true command="/usr/bin/systemctl stop ssh" user=root schedule={minute="0", hour="0"} Expected end of text, found 's' description="stop ssh" enabled=true command="/usr/bin/systemctl stop ssh" user=root schedule={minute="0", hour="0"}
How can I specify the schedule dictionary?
Last edited: