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
    Commented 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .