Introduction: you can use the crontab command to modify the crontab configuration file, which is then executed by the cron utility at an appropriate time. The permission to use this command is
Introduction:
You can use the crontab command to modify the crontab configuration file, which is then executed by the cron utility at the appropriate time. The permission to use this command is for all users.
General format:
Crontab [-u user] {-I |-r |-e}
-I: list the current time tables.
-R: generate the current time table
-E run the text editor to set the time table.
Crontab file format: "m h d m d cmd"
Corresponding to minutes, hours, days, months, and the sh program to be executed.
Therefore, crontab can be used to regularly execute a program, which increases the robustness of the program.
Example:
There is a/home/code/print. sh:
#! /Bin/sh
Echo "Hello! "
Edit the/etc/crontab file and add a line at the end:
30 * root/home/code/print. sh
This means that print. sh is run every 30 minutes with the root user.
If you have reprinted the results of your hard work, please indicate the source. thank you!