Linux crontab and linuxcrontab
Write a little bit every day. One day, the salted fish will become more salty.
The cron service is a linux scheduled execution tool that can run jobs without manual intervention. The frequency can be divided
Minute hour day month week, format:
1. crontab service:
Service crond start service
Service crond stop service
Service crond restart service
Servcie crond reload hot update
View service crond status
Crontab-e: Modify scheduled task content
2. cron configuration file directory
In the/var/spool/cron/directory, the scheduled task configuration file of each user in the system will exist. It is generally named after the user name, therefore, when you use the crontab-e command to modify a scheduled task, you must check whether your current user permissions are correct.
3. crontab usage
Crontab is used to add, modify, and delete scheduled tasks. each user has his/her own crontab file. The crontab format is as follows:
Min hour day mon week order
Instance:
0 0 ***/home/ubuntu/tets. sh
Run the test. sh script at every day.
-L timed task output
-R Delete
-E modify
4. crontab instance
0 6 ***/home/ubuntu/test. sh>/home/ubuntu/test. log
Run the test. sh script at every morning and write the script output to the test. log file.
0 */1 ***/home/ubuntu/test. sh>/home/ubuntu/test. log
Run test. sh every hour.
1/*****/home/ubuntu/test. sh>/home/ubuntu/test. log
Run test. sh every minute.
0 11-23/2 ***/home/ubuntu/test. sh>/home/ubuntu/test. log
Run test. sh every two hours from to every day.
0 0 1 **/home/ubuntu/test. sh>/home/ubuntu/test. log
Executed on the 1st day of every month
0 0 ** 3/home/ubuntu/test. sh>/home/ubuntu/test. log
Execute at every Wednesday