Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am working on CentOS.

I have created a PHP file which run from browser

http://mydomain.com/backupfile/dobackup.php

I have added the script from crontab and made the file executable, but it is not running

30 0 * * * /var/www/vhost/mydomain.com/httpdocs/backupfile/dobackup.php

what should i do?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Add shebang at the top of your code

#!/usr/bin/php
share|improve this answer
    
... and make sure to chmod +x the file. –  derobert Nov 14 '12 at 14:32
add comment

Or just execute php parser with script as an argument

30 0 * * * /usr/bin/php /var/www/vhost/mydomain.com/httpdocs/backupfile/dobackup.php
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.