moliets
moliets

Reputation: 39

cronjob will not start on weekday

I have to start a cronjob on every Thursday. Here is the script.

It will not start at all.

Manually it does his work but not as a cronjob.

It should start at 17.00 every Thursday:

00 17 * * 4 root cd /var/www/domein.nl/admin/scripts && php -f send_newsletter_subscribers.php

also tried to do as text: wed

33 15 * * wed root cd /var/www/domein.nl/admin/scripts && php -f send_newsletter_subscribers.php

Have no idea why it doesn't work. Does anybody have any suggestion what I'm doing wrong?

Thanks in advance for replying.

Upvotes: 0

Views: 62

Answers (2)

HelpBox
HelpBox

Reputation: 51

Think about setting some important variables in your /etc/initab (specially PATH and SHELL).

My /etc/initab file contains the following:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/root

Upvotes: 0

R Perrin
R Perrin

Reputation: 481

Is this an individual user's crontab (edited with crontab -e) or a system level crontab file? If the former, then the syntax is wrong, and you need to remove the user specification ("root").

The time and date fields look fine.

Upvotes: 1

Related Questions