Pagoda scheduled task execution level set number of seconds

Implementation of the minimum scheduled tasks pagoda cycles per minute, the value of minutes does not support the decimal point, but the timing is sometimes necessary to perform the number of seconds.

1. Add Scheduled Task, Task Type Select "Shell Script", the execution cycle selection N minutes, the minutes can temporarily fill in.

2. Add the contents of the script, the following script.

#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH step=3 for (( i = 0; i < 60; i=(i+step) )); do curl -sS --connect-timeout 10 -m 60 'http://www.baidu.com/' echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------" sleep $step done exit 0

3. The above step for the number of seconds, 3 seconds above, you can easily set up, after adding click on "execution."

 

No public

Guess you like

Origin www.cnblogs.com/zerofc/p/11240778.html