Few bullet-points on how to edit crontab and use cron to schedule jobs:
1] Edit /etc/config/crontab file and add your custom job to the scheduler. I’m scheduling backup of my MySQL databases (mysqlbackup.sh in /bin) to happen daily at 0:45 AM so the syntax will be:
45 0 * * /bin/mysqlbackup.sh
Please follow these instructions to choose custom timing:
2] Run crontab /etc/config/crontab to make cron aware of changes to crontab file.
3] Restart cron – /etc/init.d/crond.sh restart
4] Check the new crontab by using crontab -l or by cat /etc/config/crontab
/EDIT
I have just realized that in my last line when you run the .sh script you need to provide an absolute path. It should read:
/bin/sh /bin/mysqlbackup.sh
Now it will work!
Pingback: Qnap – Add jobs in cron « rodezio
you are my hero, every night at 3 am my rest is disturbed by the noise of de disks of the qnap
You see the secret is not to sleep in the same room! 🙂
What have you scheduled to run at 3AM by the way?
Nice tutorial..!! we also scheduled to run at 3AM the Qnap, while workers are away..
Thank you Adrian!
More than welcome! 🙂
the suggested entry lacks a field. it should have three stars, five fields including “45” (minutes) and “0” (hours), not four…
Good article! I pingbacked it here: https://www.en0ch.se/qnap-and-rsync/ But, please edit the post and correct the /bin/sh /bin/mysqlbackup.sh directly, rather than the notice in the end. Thanks! 🙂
Pingback: Projet de CRON sur QNAP – Super Méga Top
Nice tool:
https://crontab.guru/#*/5_4_*_*_*
You can calculte the crontab schedule settings
Hello Adrian, did you reboot the NAS afterwards?
At least if I reboot my TS 469U the changes in the crontab are gone.