conso.sh docs
Schedule a job
Set up recurring work with cron or systemd timers.
Cron
Run crontab -e as the user that should own the job. Add the following line, replacing the script path and creating a private writable directory for its log if you change the destination. The job runs at 02:00 in the VM’s local timezone. Use absolute paths and pass any required environment explicitly.
cron
0 2 * * * /home/worker/bin/run-job >> /home/worker/job.log 2>&1systemd timer
Create the dedicated worker user and the executable referenced below, then save these as /etc/systemd/system/worker-job.service and /etc/systemd/system/worker-job.timer.
ini
[Unit]
Description=Run the scheduled worker job
[Service]
Type=oneshot
User=worker
ExecStart=/home/worker/bin/run-jobini
[Unit]
Description=Run the worker job every morning
[Timer]
OnCalendar=*-*-* 02:00:00
Persistent=true
[Install]
WantedBy=timers.targetbash
sudo systemctl daemon-reload
sudo systemctl enable --now worker-job.timer
systemctl list-timers worker-job.timer
sudo journalctl -u worker-job.service -n 50Persistent=true can trigger a catch-up run when the timer becomes active. Make the task safe to retry and check the VM’s timezone and the next trigger.