PDA

View Full Version : Nedd Help On Crontab/Cron Please


pg001
27th June 2008, 11:21
I can't seem to make my cronjob work, I am new to cron.
I followed Debian Etch Perfect Server Setup with ISPConfig running.
My crontab looks like this:

30 00 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/logs.php &> /dev/null
59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/ftp_logs.php &> /dev/null
59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/mail_logs.php &> /dev/null
59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/cleanup.php &> /dev/null
0 4 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/webalizer.php &> /dev/null
0,30 * * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/check_services.php &> /dev/null
15 3,15 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/quota_msg.php &> /dev/null
40 00 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/traffic.php &> /dev/null
05 02 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php &> /dev/null
0 4 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/awstats.php &> /dev/null
5 * * * * /usr/bin/php -f /var/www/web1/web/sendstudio/admin/cron/cron.php &> /dev/null

I can't seem to make the last cronjob run, is it in the right format and path?

5 * * * * /usr/bin/php -f /var/www/web1/web/sendstudio/admin/cron/cron.php &> /dev/null

is /usr/bin/php the correct path to php? files at /var/www/web1/web/ are owned by web1_user.

Please help.
Thanks in advance.

chipsafts
27th June 2008, 19:28
from the command line, type in:

whereis php

pg001
28th June 2008, 01:17
/usr/bin/php is appearing when I type whereis php.

I did the crontab -e as root, should it be done as the user of the file, web1_user instead? In other words I was logged in as root when I did the crontab -e, should I be logged in as web1_user instead?

falko
28th June 2008, 21:22
What's in /var/www/web1/web/sendstudio/admin/cron/cron.php?
What happens when you run
/usr/bin/php -f /var/www/web1/web/sendstudio/admin/cron/cron.php
manually?

pg001
28th June 2008, 21:36
run manually, meaning on the command prompt? When I logged in as web1_user not root and try to type

5 * * * * /usr/bin/php -f /var/www/web1/web/sendstudio/admin/cron/cron.php &> /dev/null

i get this:

PHP Warning: Module 'json' already loaded in Unknown on line 0

/var/www/web1/web/sendstudio/admin/cron/cron.php is a php file which handles the scheduled mailing and autoresponders for my maling list manager (sendstudio).

/**
* This file handles all cron jobs together. It does:
*
* scheduled sending
* autoresponders
* bounce processing
*
* in that order.
*/

falko
29th June 2008, 14:42
run manually, meaning on the command prompt? When I logged in as web1_user not root and try to type



i get this:

The command you must run on the shell is
/usr/bin/php -f /var/www/web1/web/sendstudio/admin/cron/cron.php
not
5 * * * * /usr/bin/php -f /var/www/web1/web/sendstudio/admin/cron/cron.php &> /dev/null

pg001
29th June 2008, 15:53
I get the same message:

PHP Warning: Module 'json' already loaded in Unknown on line 0

chipsafts
30th June 2008, 02:08
hmm, post the full contents of the cron.php that is not running. falko, would `ps ax` show a stuck cron job, if that is what json is?

pg001
30th June 2008, 03:52
thanks for all the help chipsafts and falko, things are running properly now, I guess I just mistyped something on the crontab, the script/software is running properly now and sending emails.

falko
30th June 2008, 16:26
I get the same message:

Open /etc/php5/apache2/php.ini and comment out or delete the line
extension = json.so
Restart Apache afterwards.

torusturtle
19th July 2008, 17:40
In my case I had to comment it out in the file /etc/php5/cli/php.ini