这是我第一次尝试设置cronjob以自动在Jenkins中进行更新。 目前,我到目前为止已完成以下操作:
1. sudo crontab -e # opens the cron tab which will/should put the file in /var/spool/cron
2. @daily yum update # running the updates daily
这可以解决问题,但
sudo cd /var/spool/cron
时,我看不到任何crontab
。但是当我做sudo crontab -l
时,它显示了@daily yum updates
@daily yum updates
写到crontab
?答案 0 :(得分:0)
一种方法是-
#write out current crontab
crontab -l > mycron
#echo new cron into cron file
echo "@daily yum updates" >> mycron
#install new cron file
crontab mycron
rm mycron