System environment (CentOS5) create a scheduled task in Linux: (1) configure the/etc/crontab file at the system running level, to execute all scripts under/etc/daily at every day, use the following format: user command script path or contents in the time-sharing day, month, and week...
System environment (CentOS 5)
Create a scheduled task in Linux:
(1) The first method is to configure the/etc/crontab file at the system running level. to execute all the scripts under/etc/daily at every day, the following format is used:
User command script path or directory by hour, day, month, and week
18 15 * root run-parts/etc/cron. daily
Note: run-parts is used to execute all scripts in the directory.
The user column must be filled in. generally, it is root.
If you only need to run a script, leave the command column empty (and do not need to *) and add the path directly after it, such as/etc/cron. daily/backup. sh (the script does not have to have a suffix)
After modification, the scheduled task service (service crond restart) needs to be restarted to take effect.
(2) The second method is user-level. execute the crontab-e command to directly add scheduled tasks. the format is similar to (1), but you do not need to specify a user, that is, the user column does not fill in anything (* No. is required), and the others are the same.