crontab 时差问题 ubuntu 22.04
sudo timedatectl set-timezone Asia/Shanghai
crontab -e
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
TZ=Asia/Shanghai
21 15 2 * * echo "hello" >> /home/xxxx/aaa.txt
sudo systemctl restart cron