我想通过在我的服务器中执行此操作来添加一个 crontab 计划:
echo "30 * * * */home/my/var/dir/to/script/var/etc/etc/etc/"> crontab -e
有没有一种方法可以在不执行 crontab -e 然后输入命令的情况下执行此操作?
最佳答案
可以试试
1)nano /etc/crontab (or any other editor, e.g. emacs)
2)echo "30 * * * * /home/my/var/dir/to/script /var/etc/etc/etc/" > /etc/crontab
3)or put the contents of this into a file, then do "file > /etc/crontab"
关于没有 crontab -e 的 crontab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3186471/