There is a problem with crontab executing every second php think jiaoben, please teach me, thank you
First: there is no problem with crontab executing every second
*/1 * * * * php /home/www/ygkj/think jiaoben
Second: There is a problem with crontab executing every second, it will not succeed
The content of the shell script file:
#!/bin/bash
step=2 #The number of seconds in the interval, cannot be greater than 60
for (( i = 0; i <60; i=(i+step) )); do
php /home/www/ygkj/think jiaoben
sleep $step
done
exit 0
Trouble, thanks,
This sentence is wrong, how should I write it?
php /home/www/ygkj/think jiaoben
Change to $(php ‘/home/www/ygkj/think jiaoben’)
It doesn’t work either
1st postscript · 113 days ago
@Everyone,
I have solved the problem, the solution is as follows, thank you
sh file content, sh got 777
Maybe there is a pit shell script to solve “/bin/bash^ M: bad interpreter: No such file or directory”
After adding the scheduled task, you have to check whether the log is running successfully
tail -f /var/log/cron
If you have any problems, Baidu in time
There is a problem with crontab executing every second, php think jiaoben, please teach me, thank you
First: there is no problem with crontab executing every second
*/1 * * * * php /home/www/ygkj/think jiaoben
Second: There is a problem with crontab executing every second, it will not succeed
The content of the shell script file:
#! /bin/bash
step=2 #The number of seconds in the interval, cannot be greater than 60
for (( i = 0; i <60; i=(i+step) )); do
php /home /www/ygkj/think jiaoben
sleep $step
done
exit 0
Trouble, thank you,
This sentence is wrong, how should I write it?
php /home/www/ygkj/think jiaoben
Change to $(php ‘/home/www/ygkj/think jiaoben’)
It doesn’t work either