Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
0 3 1 * * /var/www/crons/monthly_billing.php 2>&1

Also anyone see any problems with it?

share|improve this question

migrated from stackoverflow.com 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
add comment

3 Answers

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.