Create a timed task for the current user to automate the program at a specific time.
1. First enter CRONTAB-E edit crontab service file
For example: File contents are as follows
#00 */1 * * * CD/HOME/WORK/LIHEHAN/QUBUILD/EXTRA; SH build.sh 1>>err.log 2>&1
0 7 4 * CD home/work/mapred; Nohup sh run.sh >> nohup.out 2>&1
Save exit
2. Type crontab-l to see if the Crontab service under the user is created successfully
3. crontab Command options:
- -u Specifies a user
- -l lists a user's task schedule
- -R Delete a user's task
- -e Edit a user's tasks
4. cron file Syntax:
Hour of the week order
0-59 0-23 1-31 1-12 0-6 Command (value range, 0 for Sunday One a row corresponds to a task)
Remember the meanings of several special symbols:
- "*" represents a number in the range of values,
- "/" stands for "every",
- "-" represents a number to a number,
- "," separate a few discrete numbers
Linux timed Tasks