Examples of Linux experiments----The implementation of "/etc" files under the "/usr/lobal" directory every 2 minutes
· Step1: Edit the current user's crontab and save
Terminal input:
>crontab-u root-l #查看root用户设置的定时器
>crontab-u root-e #进入vi编译模式
xx-2 * * * * */bin/bash/usr/local/crontab_test.sh
#Esc退出编辑模式, save by entering ": Wq" at the end of the file
· STEP2:/usr/local directory, write crontab_test.sh file
#!/bin//usr/localdd= ' date +%d ' MM= ' date +%M ' SS= ' date +%S ' backetc= /"filebackup finished! "
· STEP3: After the file is built, enter the following command in the terminal to modify the permissions of the file
>chmod u+x crontab_test.sh
-----------
(after a few minutes, you can find more than a few *.tar.gz files by looking in the/usr/local directory!)
attached: Specific Linux under the use of crontab can refer to the "Man crontab" command!
Linux timer (crontab) instance