Execute the script at the specified time under linux 2017.2.27

First, I want to add a script to be executed regularly in crontab

       1. Save all tasks in the current crontab to a temporary file crontab -l> directory/<temporary file name>;

       2. Put the script to be added in <temporary file name> 

            echo "0,5,10,15,20,25,30,35,40,45,50,55 ** * * directory/script to be executed >> /dev/null 2>&1" >> directory/<temporary File name>.

       3 Restart crontab and execute <temporary file name> crontab directory/<temporary file name>


Secondly, the timing execution script for deleting crontab is the same as above

         1. Save all tasks in the current crontab to a temporary file

         2. Find the script you want to delete in <temp folder> and delete it

        3. Restart crontab to execute <temporary file name>


Guess you like

Origin blog.csdn.net/u014179640/article/details/58106559
Recommended