1

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?

2 Answers 2

4

Add shebang at the top of your code

#!/usr/bin/php
1
  • ... and make sure to chmod +x the file.
    – derobert
    Nov 14, 2012 at 14:32
3

Or just execute php parser with script as an argument

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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