For beginners, Linux system commands are the main learning content. In many Linux commands, some commands can be run periodically. The following small series will give you a detailed introduction to the usage of the timed running commands in Linux. Let's go.
1. Introduction
command
Each user has a different task list program with their own login account to run
code is as follows:
crontab -l
You can view the scheduled tasks of each task. You can modify your own scheduled tasks by using the following commands.
The code is as follows:
crontab -e
After each task is added, you must remember to restart the crond service, otherwise it will not take effect
The code is as follows:
service crond restart
2. Examples
Below is a sample of a scheduled task
The code is as follows:
#4 of every month and every week of the week 1 to Wednesday 11 Point
0 11 4 * mon-wed date
The above sentence means “<4 every month and every week from Monday to Wednesday at 11:00 am Time & rdquo;, you change the date to the command you want to execute, and then change the execution time, you can form a timed execution command
code Bottom:
#Execute once per minute
*/1 * * * * date
#Write a shell script under /root/run_sh/and name it run. Sh, the content is as follows
#! /bin/sh
echo hello 》 /root/Hello.txt
Then run the crontab -e command and write the
code as follows:
* /1 * * * * /root/run_sh/run.sh (must be absolutely path)
After saving and exiting, execute service crond restart. After one minute, you will see Hello.txt under /root. file.
Previous123Next page Total 3 pages
Nowadays computers have DVD burners, how do you know the name and writing speed of your computers DV
Dynamic library can save disk and memory space, make program upgrade easier, increa
Linux system, sometimes need to re-mount var partition to free up space, and the theoretical explana
VPN is a virtual private network. It has the characteristics of low cost and easy t
How to install the whois command on the CentOS system
Getting Started with Linux Network Protocols
How to delete the specified file in swap
What should I do if the Java process under Linux system disappears without cause?
How to identify open and fopen functions in Linux
What commands are used for Linux system monitoring?
How to configure yum source in CentOS system
Linux which command to find files using
How to modify the Tab in the VIM editor to 4 spaces
Linux git bash garbled solution
Linux df command using instance summary
How to solve the problem of cant find libjava.so under Ubuntu?
Optimizing NTFS System under Windows 2000
How win7 system uses syskey command to improve system security
In-depth application of Windows file protection features
How to cancel the win7 toolbar preview function?
Win 8 system Microsoft ID landing CPU usage high Hard disk lights have been flashing
Notebook easily build wifi network
Cleverly solve the problem that IE can't be used normally in Win8
Run the League of Legends under Win8.1 LOL appears incompatible blue screen problem solution
System Daquan teaches you to solve various overheating methods of CPU overheating