1024programmer PHP There is a problem with crontab implementation per second PHPthinkjiaoben, please teach me, thank you

There is a problem with crontab implementation per second PHPthinkjiaoben, please teach me, thank you

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

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/there-is-a-problem-with-crontab-implementation-per-second-phpthinkjiaoben-please-teach-me-thank-you/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索