Linux implementation of regular tasks

  A. A way

   (1) The method of the command line:

  A way a.   

     Requirements: executed once per minute / etc directory is added to the / tmp / a.txt in 

    ( 1 ) Touch a.txt create a file 

    ( 2) crotab -e customized tasks * / 1 * * * * ls -l / etc / >> / tmp / a.txt 

     ( . 3 ) to view the contents of the timing tasks: cat a.txt      

      view timing of tasks: the crontab - L 
     ( . 4) the timing of withdrawal tasks: crontab -r  

  II. Second way

    (2) shell script to perform regular tasks

   Second way 
    1.CD / Home in MyTest1 mkdir
    
2 .cd MyTest1 created test2.txt file Touch
    
3 .vim mytt.sh task assignment editor      DATE >> / Home / MyTest1 / test2      CAL >> / Home / MyTest1 / test2 (test2 added to the calendar)      4. task Timing: crontab -e edit timer task * / 1 * * * * /home/mytest1/mytt.sh "" " Oh execution entry

 

   

                            

Guess you like

Origin www.cnblogs.com/mofujin/p/12070175.html