When connected to Dropbox and running the clean command, it just says 'Cleaning backups of xxx on disk dropbox...' and this just stays there for hours. Nothing happens? Backups do work, just not the cleaning.
My app doesn't hang like that, but it doesn't clean the Dropbox backups either. Is this a readme misinterpretation or a bug? Because I know most packages like this don't support cleaning backups stored on third-party services.
The package should be able to delete backups on external filesystems. I'll look into this soon.
@AlexVanderbist could you try to reproduce this?
Thanks! FYI: latest Laravel 5.4, fresh install, "app folder" Dropbox app. Let me know if you need any more info or help.
Backing up, monitoring and cleaning backups seems to work fine for me on Laravel 5.4 (Homestead on Windows 10 host) with the latest league/flysystem-dropbox (1.0.4) and dropbox/dropbox-sdk (1.1.7). Could you verify that you're using the same versions for these packages?
To test this I modifed the laravel-backup.php config file to clean all backups (other than the latest) by setting keepAllBackupsForDays to 0. Then running php artisan backup:run for a couple of times before php artisan backup:cleaning them.

Could you please post your laravel-backup.php config file so I can take a look at it? Thanks.
Same versions here. Does it check backup dates by name or by actual creation date? I've created a bunch of test zip archives dating back a few months. When running the clean command, it deletes all of them up to a few days ago while my clean strategy dictates to keep weekly, monthly, yearly backups. My archives are only 7KB each (just the .env file and a database dump), so in total it doesn't exceed the 50MB limit either. Testing this locally btw.
Btw, what terminal theme are you using? :)
/*
* The number of days for which backups must be kept.
*/
'keepAllBackupsForDays' => 1,
/*
* The number of days for which daily backups must be kept.
*/
'keepDailyBackupsForDays' => 3,
/*
* The number of weeks for which one weekly backup must be kept.
*/
'keepWeeklyBackupsForWeeks' => 4,
/*
* The number of months for which one monthly backup must be kept.
*/
'keepMonthlyBackupsForMonths' => 2,
/*
* The number of years for which one yearly backup must be kept.
*/
'keepYearlyBackupsForYears' => 2,
/*
* After cleaning up the backups remove the oldest backup until
* this amount of megabytes has been reached.
*/
'deleteOldestBackupsWhenUsingMoreMegabytesThan' => 50,
Edit: so yeah, testing manually won't work unless I set the archive dates. I'll let my production backup run and clean for a few weeks and revisit this issue then. At least I have backups now ;)
public function date(): Carbon
{
return Carbon::createFromTimestamp($this->disk->lastModified($this->path));
}
Hi Sebastiaan,
The package checks the last modified date on the archive file. So when you created your test archives, they probably got deleted because the timestamp in the filename doesn't get considered. You could use the touch -d command to set the last modified dates.
(The terminal theme is the default Cmder theme with the Solarized Git color scheme. I'm not sure whether it's available as a oh-my-zsh theme tho)