waxical
waxical

Reputation: 3896

Another of the:- Cronjob not working

I have a cronjob, which is ni-on identical to other cronjobs that do work. But, for some I see nothing from this:-

* * * * * /usr/bin/php -f /var/www/vhosts/process/sync.php > /var/www/vhosts/process/logs/synclog.log 2>&1

I want to run every minute, of every day, forever. However, this script isn't be actioned. I know this as I can run it from CLi and it works, as well as outputting a file.

Is there something wrong in the command? If not, is there a way to monitor this command so I can see the issues?

I've also checked the permissions, and they're identical to the other files that do work.

Many thanks for any help.

Upvotes: 0

Views: 149

Answers (1)

James Williams
James Williams

Reputation: 4216

some linux servers use different syntax. To run a job every minute there is 3 ways.

* * * * * /usr/bin/php -f /var/www/vhosts/process/sync.php > /var/www/vhosts/process/logs/synclog.log 2>&1
*/1 * * * * /usr/bin/php -f /var/www/vhosts/process/sync.php > /var/www/vhosts/process/logs/synclog.log 2>&1
1 * * * * /usr/bin/php -f /var/www/vhosts/process/sync.php > /var/www/vhosts/process/logs/synclog.log 2>&1

Depending on server and setup one of these should work. Since you already stated the first does not, try one of the other two. I know my hosting server, I cannot use */1.

Upvotes: 3

Related Questions