someone1 / zfsbackup-go

Backup ZFS snapshots to cloud storage such as Google, Amazon, Azure, etc. Built with the enterprise in mind.
MIT License
340 stars 43 forks source link

[enhacement] Pad number in name with 5-6 zeros. #36

Open aensidhe opened 4 years ago

aensidhe commented 4 years ago

Let's take that name: mimir/private|autosnap_2020-07-09_22:45:01_frequently.zstream.gz.pgp.vol1000.

Format mimir/private|autosnap_2020-07-09_22:45:01_frequently.zstream.gz.pgp.vol_000_001_000 is more readable and sortable.

image

someone1 commented 4 years ago

Is there a use-case for this? I don't want to assume I know the number of volumes a job may take, and the name is really arbitrary as the manifest is what really matters. The list command should hopefully give you the data/insight you need regarding a backup set.

aensidhe commented 4 years ago

Use case is to provide sorted set. So, in file list it would be not "1, 10, 100, 1000, 2", but "0001, 0002,etc".

I believe zfs list gives you size of snapshot. You can use that to get maximum amount of chunks you will have.

In any case, nine digits proposal with default size of 200MB is enough for backing up 200PB. You can add the digits more and you're fine with exabytes