Reputation: 1
I have a following problem guys, my PHP script is like this:
#!/usr/bin/php
<?PHP
// Define the path to file
$file = 'mydb.sql';
if(!file)
{
// File doesn't exist, output error
die('file not found');
}
else
{
// Set headers
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: inline; filename=$file");
header("Content-Type: application/x-sql ");
header("Content-Transfer-Encoding: binary");
// Read the file from disk
readfile($file);
}
?>
Now I want to call my PHP script via crontab, and my cron command is:
0 0 * * * /web/conf/ -q /home/content/81/10928381/html/dumper/work/backup/pr_download.php
But why, every time i run my script, it's always sent me an error message : /bin/sh: 0: command not found
Can you help me guys?
Thanks
Upvotes: 0
Views: 3012
Reputation: 11832
what is /web/conf/
? you are missing an executable command here... did you want wget
?
if you want to use your php executable instead, look where the executable is. eg /usr/sbin/php
then do
0 0 * * * /usr/sbin/php -f /home/content/81/10928381/html/dumper/work/backup/pr_download.php
Upvotes: 3
Reputation: 4523
I think I had the same error when trying to execute a Windows file (DOS format) as a script.
Try this :
dos2unix pr_download.php
and then try running your script again.
Let me know if it works.
Upvotes: 0
Reputation: 1493
try this
php -f /home/content/81/10928381/html/dumper/work/backup/pr_download.php >> /tmp/script_log.log
Upvotes: 0