Open nomandera opened 3 years ago
I build this to be able to safely rollback after a failed upgrade. I'm not sure when to delete the backup. Maybe after the next upgrade? But what if the user executes the installer twice?
Seems like a sensible safety net. I am sure it will save some one some day so without question it needs to stay.
The question then is I suppose how long the backups are useful for. I would suggest that they have very high value for a very short time i.e "oh god its broken on upgrade". After that its a game of diminishing returns except for a case where something is subtly broken or lost and that takes some time to spot.
From my stance i care far more about disk space than how many versions since small VPS storage is the most expensive differentiator.
How about a different approach. We could add the space used by this into the capacity warning notice email and include instructions how to react.
This is part of Nextcloud upgrade. At the beginning of this :
Installing Nextcloud (contacts/calendar)... Upgrading Nextcloud --- backing up existing installation, configuration, and database to directory to /home/user-data/owncloud-backup/2021-05-19-19:22:50...
Upgrading to Nextcloud version 20.0.1
I neither use Nextcloud. Putting a cron job to clear this directory every hour is for me a good solution. Maybe at the end of an MIB update script.
Looking at my timestamps, hourly seems perhaps a bit too frequent and overrides what appears to be a useful function. How about a weekly cron job that deletes some number of days past the timestamps? They all seem to be timstamped on the day I imagine I ran the Mail-in-a-Box version update, which is also the name of the subdirectory. I think if I haven't reverted within 30 days, it's safe to assume everything is peachy keen.
Circling back to this. I just had a mail outage due to being out of space disk.
/home/user-data/owncloud-backup# du -h -d1
418M ./2021-07-01-13:50:32
456M ./2023-11-08-13:06:10
630M ./2023-11-08-12:59:24
406M ./2022-02-01-16:50:46
454M ./2023-11-08-13:09:44
4.0K ./2023-11-08-12:51:43
2.4G .
I think we need to address this in some way so that this cannot happen for anyone. For context I do not use nextcloud at all.
Hunting down consumed disk space and I find the following:
I dont use Nextcloud other than as an install dependency so I assume this is detritus left from the necessary major version bumps.
Do we need a separate backup process for Nextcloud and if we do then should we maintain quite so many backups?