vzdump-plugin-b2
vzdump-plugin-b2 copied to clipboard
Keep multiple versions of backup
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?
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!
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?