gpt4 book ai didi

php - 为 Laravel Spatie 备份指定目标目录

转载 作者:行者123 更新时间:2023-12-05 05:20:58 26 4
gpt4 key购买 nike

我正在使用 Laravel Spatie Backup备份我的 Laravel 项目。现在备份存储在 myproject/storage/app 目录中。如何将此目录更改为例如 myproject/storage/app/some/directory?我找不到明确的答案。

我现在的 laravel-backup.php 配置:

'destination' => [

/*
* The disk names on which the backups will be stored.
*/
'disks' => [
'local'
],
],

我尝试了以下操作:'local' => '/some/directory' 但这会引发错误 Copying .zip file failed because: Could not connect to disk/some/directory因为没有设置磁盘..

最佳答案

首先进入config/filesystems.php

为您的项目添加新磁盘

  'disks' => [

'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],


// add your own disk to the project
'localBackup' => [
'driver' => 'local',
'root' => storage_path('app/your_directory') // your folder,
],

....
]

在 config/backup.php 中

 'destination' => [

/*
* The filename prefix used for the backup zip file.
*/
'filename_prefix' => 'backup_',

/*
* The disk names on which the backups will be stored.
*/
'disks' => [
'localBackup',//your disk
],
],

关于php - 为 Laravel Spatie 备份指定目标目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43850988/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com