The first method:
1. Create a script file
| The code is as follows |
Copy Code |
Cat phplog.sh 2. Edit Script Content #!/bin/bash While:;d o /home/scripts.sh 2>/dev/null & Sleep 1 Done
|
Note: Do not use bash phplog.sh & the way the background runs this first time, it will be zombie.
Workaround: You can put it on a scheduled task to run it, and then delete this entry from the scheduled task. Finally, put the script in/etc/rc.local so that it can be run every time it is powered on.
The second method:
| The code is as follows |
Copy Code |
1. Create a script file Cat phplog.sh 2. Edit Script Content #!/bin/bash For ((i=1;i<=20;i++));d o /home/scripts.sh 2>/dev/null & Sleep 1 Done 3. Edit Crontab Script * * * * */bin/bash/home/somedir/phplog.sh * * * |
The third method:
1. Edit Crontab Script
| The code is as follows |
Copy Code |
* * * * */home/scripts.sh * * * * * * * * * Sleep 1 &&/home/scripts.sh * * * * * * Sleep 2 &&/home/scripts.sh * * * * * * Sleep 3 &&/home/scripts.sh ... * * * * * * sleep &&/home/scripts.sh * * * * * sleep &&/home/scripts.sh * * * * * sleep &&/home/scripts.sh
|
Finally, a third method is recommended.