定时备份问题

* * * * * /usr/local/php/bin/php /workspace/dev1/smt_business/artisan schedule:run >> /dev/null 2>&1

踩坑的来了 加上php 路径后到是可以运行了,但是又报 mysqldump 找不到了 路径是填写对了的服务器上路径/usr/local/mysql/bin/mysqldump, 配置填的/usr/local/mysql/bin/ 手动可以备份 现在定时发邮件里面报找不到命令了

[root@iZ23rnsy0l5Z smt_business]# php artisan backup:run

Starting backup...

Dumping database smt_manufacturer...

Dumping database smtapp_location...

Determining files to backup...

Zipping 1174 files...

Created zip containing 1174 files. Size is 15.51 MB

Copying zip to disk named local...

Successfully copied zip to disk named local.

Backup completed!

这是手动执行可以备份成功

下面这是邮箱发送的报错信息

Whoops!

Important: An error occurred while backing up `Laravel`

Exception message: `The dump process failed with exitcode 127 : Command not found : sh: mysqldump: command not found `

Exception trace: `#0 /data/wwwroot/smt_business/vendor/spatie/db-dumper/src/DbDumper.php(222): Spatie\DbDumper\Exceptions\DumpFailed::processDidNotEndSuccessfully(Object(Symfony\Component\Process\Process)) #1 /data/wwwroot/smt_business/vendor/spatie/db-dumper/src/Databases/MySql.php(88): Spatie\DbDumper\DbDumper->checkIfDumpWasSuccessFul(Object(Symfony\Component\Process\Process), '/data/wwwroot/s...') #2 /data/wwwroot/smt_business/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(200): Spatie\DbDumper\Databases\MySql->dumpToFile('/data/wwwroot/s...') #3 [internal function]: Spatie\Backup\Tasks\Backup\BackupJob->Spatie\Backup\Tasks\Backup\{closure}(Object(Spatie\DbDumper\Databases\MySql), 0) #4 /data/wwwroot/smt_business/vendor/laravel/framework/src/Illuminate/Support/Collection.php(603): array_map(Object(Closure), Array, Array) #5 /data/wwwroot/smt_business/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(203): Illuminate\Support\Collection->map(Object(Closure)) #6 /data/wwwroot/smt_business/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(133): Spatie\Backup\Tasks\Backup\BackupJob->dumpDatabases('/data/wwwroot/s...') #7 /data/wwwroot/smt_business/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(113): Spatie\Backup\Tasks\Backup\BackupJob->createBackupManifest() #8 /data/wwwroot/smt_business/vendor/spatie/laravel-backup/src/Commands/BackupCommand.php(43): Spatie\Backup\Tasks\Backup\BackupJob->run() #9 [internal function]: Spatie\Backup\Commands\BackupCommand->handle() #10 /data/wwwroot/smt_business/vendor/laravel/framework/src/Illuminate/Container/Container.php(508): call_user_func_array(Array, Array) #11 /data/wwwroot/smt_business/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array) #12 /data/wwwroot/smt_business/vendor/symfony/console/Command/Command.php(254): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #13 /data/wwwroot/smt_business/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #14 /data/wwwroot/smt_business/vendor/spatie/laravel-backup/src/Commands/BaseCommand.php(22): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #15 /data/wwwroot/smt_business/vendor/symfony/console/Application.php(820): Spatie\Backup\Commands\BaseCommand->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #16 /data/wwwroot/smt_business/vendor/symfony/console/Application.php(187): Symfony\Component\Console\Application->doRunCommand(Object(Spatie\Backup\Commands\BackupCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #17 /data/wwwroot/smt_business/vendor/symfony/console/Application.php(118): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #18 /data/wwwroot/smt_business/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(121): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #19 /data/wwwroot/smt_business/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #20 {main}
JellyBool
修改的评论也不能少于六个字哦!
manpai
修改的评论也不能少于六个字哦!
JellyBool
修改的评论也不能少于六个字哦!
chenxin 回复 JellyBool
修改的评论也不能少于六个字哦!
JellyBool 回复 chenxin
修改的评论也不能少于六个字哦!
manpai
修改的评论也不能少于六个字哦!