欢迎来到思维库

思维库

在Linux中怎么使用cron计划任务

时间:2025-11-03 18:10:02 出处:域名阅读(143)

在Linux中怎么使用cron计划任务
复制# crontab -e  SHELL=/bin/bash  MAILTO=root@example.com  PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin  # For details see man 4 crontabs  # Example of job definition:  # .---------------- minute (0 - 59) # |  .------------- hour (0 - 23) # |  |  .---------- day of month (1 - 31) # |  |  |  .------- month (1 - 12) OR jan,使用feb,mar,apr ... # |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # |  |  |  |  |  # *  *  *  *  * user-name  command to be executed  # backup using the rsbu program to the internal 4TB HDD andthen 4TB external  01 01 * * * /usr/local/bin/rsbu -vbd1 ; /usr/local/bin/rsbu -vbd2  # Set the hardware clock to keep it in sync with the more accurate system clock  03 05 * * * /sbin/hwclock --systohc # Perform monthly updates on the firstof the month # 25 04 1 * * /usr/bin/dnf -y update 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.

分享到:

温馨提示:以上内容和图片整理于网络,仅供参考,希望对您有帮助!如有侵权行为请联系删除!

友情链接: