2016-05-22 67 views
1

我有下面的命令設置備份Laravel命令未正常工作的cron

db:backup --database=mysql --destination=s3 --destinationPath=date +\test/%Y%m%d%H%M%S.sql--compression=gzip 

代碼工作正常,如命令

時,同樣是從調度運行與local.ERROR: exception 'BackupManager\ShellProcessing\ShellProcessFailed' with message 'sh: mysqldump: command not found失敗。

有任何建議。

+0

看看這個:http://stackoverflow.com/questions/2135478/h ow-to-simulate-the-environment-cron-executed-a-script-with,因爲我認爲它在通過crontab運行時涉及到不同的環境問題 – Amarnasan

+0

@Amarnasan可能是對的,但是請張貼您的命令以便更容易告訴。 –

+0

嗨@Amarnasan,我的調度程序工作正常,因爲我有其他調度程序命令工作正常。關於備份comman,它來自laravel備份插件https://github.com/backup-manager/laravel –

回答

0

是的,他知道了細節。作爲cron的運行時

殼路徑未初始化

解決方案是創建的shell腳本,並從cron:用cron

的crontab

* * * * * bash /path/cron.sh 

cron.sh

之前發起的.bash_profile叫它
. .bash_profile 
<cron command>