mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
14.02k stars 1.44k forks source link

owncloud-backup cleanup #1879

Open nomandera opened 3 years ago

nomandera commented 3 years ago

Hunting down consumed disk space and I find the following:

root@box:/home/user-data/owncloud-backup# du -h -d1
282M    ./2020-12-01-18:16:56
236M    ./2019-08-26-08:11:12
275M    ./2020-06-01-11:38:01
236M    ./2020-04-03-11:05:55
1.1G    .

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?

yodax commented 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?

nomandera commented 3 years ago

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.

fkieber commented 3 years ago

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.

myfirstnameispaul commented 3 years ago

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.

nomandera commented 10 months ago

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.