The difference between at and crontab in Linux: 1. The running methods are different, at only runs once, while crontab runs in a loop; 2. The dependent services are different, the service corresponding to at is atd, and the corresponding service to crontab crond when serving; 3. at is generally a temporary task, while crontab is generally a periodic task.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
The difference between at and crontab
Different running methods
at only runs once , crontab runs in a loop
The services it depends on are different
The service corresponding to at is atd
The service corresponding to crontab is crond
at is generally a temporary task. Crontab is generally a periodic task
at command
Attention needs to be paid when executing at:
1 Check whether the user has at permission
If the /etc/at.allow file exists in the system, the user name existing in it will have at permission
If /etc/at exists in the system .deny file, then the user name existing in it will not have at permission (generally open source systems give the deny file by default, and it is empty)
If the above file does not exist in the system, only the root user can Use at permissions
2 Check whether the atd service has been opened
service atd status
crontab command
linux automatic execution command crontab and at
Note when executing crontab: (actually the same as at)
1 Check whether the user has crontab permissions
If /etc/cron exists in the system .allow file, then the user names existing in it will have cron permissions
If the /etc/cron.deny file exists in the system, then the user names existing in it will not have cron permissions (generally open source systems have It is given to the deny file by default, and it is empty)
If the above file does not exist in the system, only the root user can use cron permissions
2 Check whether the atd service has been turned on
service crond status
Recommended learning: Linux video tutorial
The above is the detailed content of What is the difference between at and crontab in linux. For more information, please follow other related articles on the PHP Chinese website!