【发布时间】:2013-05-16 03:58:00
【问题描述】:
我有以下问题,我的PHP脚本是这样的:
#!/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);
}
?>
现在我想通过 crontab 调用我的 PHP 脚本,我的 cron 命令是:
0 0 * * * /web/conf/ -q /home/content/81/10928381/html/dumper/work/backup/pr_download.php
但是为什么,每次我运行我的脚本时,它总是向我发送一条错误消息: /bin/sh: 0: 找不到命令
你们能帮帮我吗?
谢谢
【问题讨论】:
-
将
if(!file)更改为if(!$file)