«

pve下crontab

学长 发布于 阅读:581 Linux


因为pve是基于debian的平台并且直接运行就是root

所以没有用户crontab

crontab -l 并没有反应。。。

改etc的配置

vi /etc/crontab


# 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

然后按照上面的格式输入需要循环运行的指令

:wq

保存

然后重启crontab服务

/etc/init.d/cron restart

参考

https://forum.proxmox.com/threads/correct-way-to-edit-cron-jobs.119463/

但是貌似推荐还是crontab -e


扫描二维码,在手机上阅读