我对 unix 和 cron 很陌生,我目前正准备尝试将 cron 添加到现有的 cron 文件中。我读到你可以用crontab -e. 令我困惑的是,它crontab -e显示的 cron/命令与less /etc/crontab- 为什么会不同?哪一种是正确的编辑方式/文件?
Dub*_*ubu 15
尽管@X Tian 的回答包含有关 crontab 不同文件的信息,但有关您的问题的基本信息是:
crontab -e edits the user's crontab file (stored in the /var/spool/cron/crontabs/ directory on current Debian systems, but YMMV) or creates a new one, and not /etc/crontab. Similar for crontab -l (list crontab file) and crontab -r (remove crontab file).
For all cron jobs that should be executed under a user's account, you should use crontab -e. For system jobs, you should add a file under /etc/cron.d, if that exists; under /etc/cron.{hourly|daily|weekly|monthly} (but those must not be named like a package name!), if that fits your purpose; or add a line to /etc/crontab. But be aware that /etc/crontab might be overwritten with a system update.
| 归档时间: |
|
| 查看次数: |
32850 次 |
| 最近记录: |