crontab can periodically perform the actions you want to do
Edit directly with crontab command
crontab -u //Set a user's cron service, generally the root user is executing this This parameter is required for the command
crontab -l //list the details of a user cron service
crontab -r //delete a user's cron service
crontab -e //Edit a user's cron service
Generally use crontab -e to edit a plan action, the edit mode is the same as the vi editor
The basic editing format in crontab is as follows
* * * * * command
Time-of-day day and month week command
Column 1 means minutes 1~59 per minute with * or */1
The second column indicates the hour 1~23 (0 means 0 point)
The third column indicates the date 1~31
The fourth column indicates the month 1~12
Column 5 identification number Week 0~6 (0 means Sunday)
Column 6 command to run
crontab Some examples of the pieces:
30 21 * * * /etc/init.d/smb restart
The above example means restarting smb every night at 21:30.
45 4 1,10,22 * * /etc/init.d/smb restart
The above example shows that 4:45 restarts smb on the 1, 10, 22, every month.
10 1 * * 6,0 /etc/init.d/smb restart
The above example shows restarting smb every Saturday and Sunday 1:10.
0,30 18-23 * * * /etc/init.d/smb restart
The above example shows that smb is restarted every 30 minutes between 18: 00 and 23:00 every day.
0 23 * * 6 /etc/init.d/smb restart
The above example shows restarting smb every Saturday at 11:00 pm.
0 */1 * * * /etc/init.d/Smb restart (Note: * */1 * * * /etc/init.d/smb restart This will be executed every minute)
Restart smb every hour
0 23 -7/1 * * * /etc/init.d/smb restart
Restart smb every hour between 11pm and 7am
0 11 4 * mon- Wed /etc/init.d/smb resta Rt
Restart smb at 11 o'clock every month and every Monday to Wednesday
0 4 1 jan * /etc/init.d/smb restart
January 4 o'clock on the 1st restart smb
Sometimes when Linux has multiple network cards, you need to add routes to other network ca
on Linux A traditional VPN (such as OpenVPN, PPTP) consists of a VPN server and one or more clients
using direct-lvm storage method Recently played docker on Bluemix virtual machine, but found that t
Linux command line learning - dig (DNS querier)
Linux System Management Technical Manual - Chapter 6 Adding New Users
Linux vi editor command Daquan
Linux installation php and memcache process record
Vim is not common but very practical command skills
Computer Technology: cacti Installation and Configuration
Ubuntu suddenly does not go to the network how to do
Linux ls, ls -l, ls -l, ll command
Ubuntu configuration SSH password-free login
Teach you why you must press F1 to boot into the system
How to filter a certain type of file in Win8.1 folder
Experts can help you solve the problem of Fetion can not be started under Windows7
When is the LOLS5 Finals group draw? LOLS5 Finals Grouping Rules Description
Win10 desktop transparent folder production method
How to close win7 file protection
Win7 Protection Vision Program Set Anti-Fatigue Color Window Graphic Tutorial
How to modify login password on Sina Weibo