Laravel-backup: Backing up files in storage folder

Created on 29 Jan 2017  路  8Comments  路  Source: spatie/laravel-backup

One of my main goals with this package was to backup user-generated content in the storage/app folder (in addition to the database and code backup, which is great). I noticed that this path seems to be automatically excluded - I'm thinking maybe because the backup is also in this path? Is there a way to include specific folders under storage/app that you want included in the backup? I have a short list, I've tried explicitly including it in the "include" config and also creating a a listener for BackupManifestWasCreated and adding them there, but neither method seemed to result in my files winding up in the zip file.

Most helpful comment

Having the same issue. Seems like anything added to storage/app is being ignored.

How to reproduce:

  1. Fresh Laravel 5.4 install.
  2. Add spate/laravel-backup ^4.0.0.
  3. Export spatie/laravel-backup config.
  4. Add storage/app to the includekey in the config.
  5. Add example files to storage/app.
  6. Run php artisan backup:run --only-files.

Result:
Returns error Backup failed because There are no files to be backed up..

All 8 comments

The package will indeed automatically excluded any directory where the backup are stored in. Any other directory can be added to include key in the config file.

It's kinda strange that adding directories to that key doesn't work for you. I haven't received any other issues regarding this. Maybe the problem is caused by something specific to your project.

Could you try installing the package in a vanilla Laravel app and try to backup some directories there?

Having the same issue. Seems like anything added to storage/app is being ignored.

How to reproduce:

  1. Fresh Laravel 5.4 install.
  2. Add spate/laravel-backup ^4.0.0.
  3. Export spatie/laravel-backup config.
  4. Add storage/app to the includekey in the config.
  5. Add example files to storage/app.
  6. Run php artisan backup:run --only-files.

Result:
Returns error Backup failed because There are no files to be backed up..

@lasseal I'll take a look at this soon

This has been fixed in v4.4.3 of the package.

v4.4.3. is the version, to avoid any future confusion.

Thanks for the correction @lasseal !

Awesome thank you guys!

this issue still habbend to me also the size of generated zip is increased with the included files, but just DB backup i can see after extracting the zip file

Was this page helpful?
0 / 5 - 0 ratings