Backups deleted based on files date or date in filename?

Hi

As indicated in title, I have a little issue with the automated backup feature of Virtualmin. I have setup it to delete backups after 16 days but it doesn’t delete them right now.I guess it’s based on file date and not date encoded in the filename of backup no ? (I had to move backup files from an S3 bucket to an other one and so filedates have been resetted).

Thanks

Vincèn

I would guess that was the mistake - though I do not use S3 buckets and would not transfer them to a different one just for that reason if nothing else.

deleting by file date seems far more logical (to me) than by something in the file name.

I assume you have control over the bucket - so deletion should not be a great problem.

I’d say one of the improvements they can look into, backups are on the short list they are looking into I think, is automatically adding the date codes. Yeah, technically you have a file creation time but that is not what they use. I had to do a little digging when I set up mine.

/home/backup/domains/full/full_%Y_%m_%d

I think this was my clue as to what to look at.
image

From their point of view I guess what you include in the date depends on backup frequency. If you back up more than once a day you need to add hour to that. Not sure I need year, but…

or %d/%m%y
or %m/%d/%y
and any other personal date format
(dates are nightmare enough)

Well here I had as trying to debug a problem on the S3 storage system of my supplier where large size files deletion were timing out :frowning:
Here are how my backups right now on the new S3 storage:


Backup cron is setup to delete full backups after 16 days but once it runned the last full upgrade on the 22th it should have deleted the one done on 1st of month but it stated in logs of backup that nothing was too old to be deleted so it clearly works on filedates and not on date encoded in filenames :wink:

nope it is what they are using and not date encoded in files names :wink: which is more logical (although not helping for my tests :sweat_smile:

Hmm… I had to add the ‘strings’ to get them to delete on my systems. Or was it to keep them from getting clobbered? Been over a year now.

Funny thing: I had not noticed that the rclone copy from the old storage system to the new one kept files date but not folders date (it’s a limit of S3).
So virtualmin uses the folder date to decide if he has to delete individual archives in the folder and not date of individual archives file (my backups are setup to generate one archive per virtual server) but in the backup logs it list number of individual files not enough old to be deleted :sweat_smile:

I wouldn’t recommend using / in %m/%d/%y; it’s much simpler and cleaner to use the %Y-%m-%d-%H:%M format instead.

2 Likes

Does the ‘/’ create folders?

Yes, it assumes a directory, and whether it is created or not is defined by the option in the backup form.

1 Like

I found the backup delete functionality at least poorly documented and I didn’t want to guess what it does. So I took a little time and implemented my own solution.

Hopefully, Virtualmin gets improvements here, by either better documentation or better UI.

Yeah there is still something strange here as it looks like it’s only the directory containing backups that have date encoded in the directory name and not backups themselves. Here is how I’m setup for full backup:


and I end up with that in the backup storage:

and the automatic deletion of backups older than 16 days is not working (I had to manually delete old backups from the storage :frowning:

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.