Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I am working on CentOS.

I have created a PHP file which run from browser


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
up vote 4 down vote accepted

Add shebang at the top of your code

share|improve this answer
... and make sure to chmod +x the file. – derobert Nov 14 '12 at 14:32

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

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.