Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
0 3 1 * * /var/www/crons/monthly_billing.php 2>&1

Also anyone see any problems with it?

share|improve this question

migrated from Jun 8 '10 at 15:15

This question came from our site for professional and enthusiast programmers.

might put /usr/bin/php or whatever the path to php is on your system just to make sure. – user6738237482 Jun 8 '10 at 15:21
up vote 5 down vote accepted

man 5 crontab says... yes. Looks good. The only problem may be if the script is not set executable or is missing the shebang line.

share|improve this answer

You might need to add the path to where php is running

0 3 1 * * /usr/bin/php /var/www/crons/monthly_billing.php 2>&1

Also where are you planning on sending the output result to the users local email address (e.g. jbloggs@localhost) which it would be doing at the moment or are you after redirecting it, into a log file.

NOTE: dont copy paste the example i have given here you might need to confirm the location of where the php binary file is on your server which php is your friend for this.

share|improve this answer

Also, following on Pauls notation regarding output result. If you don't want any output (discard all output, both stdout and stderr) try:

0 3 1 * * /usr/bin/php /var/www/crons/monthly_billing.php >> /dev/null 2>&1

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.