Edit current user's crontab:
crontab -e
List user's crontab:
crontab -l
Rule, verify website: https://crontab.guru/ :
0 0 * * * "command"
The first five fields shall be integer patterns that specify the following:
Symbol:
*
(asterisk) means every xxx, for example, * * * * *
means every minutes;
,
(comma) means or, such as 1,22
means every 1/22 [classifier];
-
(hyphen) means to, such as 1-10
means from 1 to 10 [classifier];
*/
means every x [classifier], */3 [Hour field]
means every 3 hours.
Remember set envirnment at the begining of the code.
SHELL=/bin/bash LANG=zh_CN.UTF-8 LC_ALL=zh_CN.UTF-8 0 * * * * /data/backup.sh