In Linux, the crontab command is used to schedule scheduled tasks. In linux, some tasks need to be started at a specific time, you can use the crontab command to set the file in/etc/crontab. The specific steps are as follows: (1) set the task execution command: crontab-e (or vi/etc/crontab) (2) edit in the command line that appears, for example, set the current time to be displayed when you execute the data>/home/chen/mydata command for each period of time, the preceding command indicates that the current time is appended to the/home/chen/mydata file. In the preceding Editor, enter ***** data>/home/chen/mydata and save and exit, the system will execute the "data>/home/chen/mydata" command every minute. the scheduled time rule for www.2cto.com is: the time range is 1st digits: the number 0-59 indicates the number of minutes in an hour. The number 0-23 indicates the number of hours in an hour. The number 2nd indicates the number 0-31 indicates the number of days in a month: the number 0-12 indicates the number of months in a year. The number 0-6 indicates the number of days in a week. The other number is 0-6. For example, if you want to execute the command at every day, the format is: 0 2 * data>/home/chen/mydata (3) This method is not recommended when multiple tasks are scheduled, it may be confusing to write all the commands to/etc/crontab. You can first write the commands into an executable file, and then use the cr Ontab calls this executable file for implementation (that is, shell programming ). For example, after writing time into a file, copy the file to another directory and create a new file in the/home/chen Directory: vi test. sh then enter the corresponding command: data>/home/chen/mydatacp/home/chen/mydata/root/And then: crontab-e to add a line of code: 0 2 ***/home/chen/test. sh (4) command for stopping task scheduling: crontab-r (5) command for displaying the current task scheduling: crontab-l www.2cto.com --------------------- gorgeous split line -------------------- note that by default, files created using vi do not have executable permissions, so you need to modify test. sh File Permission, run the following command: chmod 744 test. sh grants him the executable permission. Here, you can run the ls-l command to view the permissions of the file: ls-l-rw-r-(10 characters) the first '-' indicates the file type (-indicates a normal file). The last three indicate the permission of the file owner to the file: r indicates that the file is readable and expressed as 4; w indicates that it can be written in 2; x indicates that the execution can use 1 to indicate 7 = 4 + 2 + 1, indicating that the user has all permissions, and the last three indicate that the user in the group has permissions on the file. The last three represent users in other groups. author of permission on this file: Chen qingxiao