vzdump-plugin-b2 icon indicating copy to clipboard operation
vzdump-plugin-b2 copied to clipboard

Keep multiple versions of backup

Open MaartenUreel opened this issue 5 years ago • 2 comments

If I understood correctly, you will always remove the other versions of the backups. However it might make sense to keep e.g. the last 14 versions, no?

Would you feel like making that into a parameter?

MaartenUreel avatar Jan 25 '20 14:01 MaartenUreel

I can’t do that myself as I don’t use B2 with Proxmox at the moment. I’d be happy to merge PR if you can prepare one, though!

padelt avatar Jan 25 '20 16:01 padelt

Unfortunately Bash scripting isn't my thing, I would have to do it in Python, but I think this could be implemented: You are using list_file_names to retrieve the files from b2 and you extract files[]|.fileName+"'$DELIMITER'"+.fileId from that.

However you could check files[]|.fileName+"'$DELIMITER'"+.uploadTimestamp and ignore files that were uploaded in the last $UPLOAD_RETENTION days?

MaartenUreel avatar Jan 26 '20 07:01 MaartenUreel