andaag / zfs-to-glacier

A tool to sync zfs snapshots to s3-glacier, written in rust.
MIT License
45 stars 4 forks source link

general: Application exits 0 if no zfs snapshots are found #3

Open stephen-fox opened 2 years ago

stephen-fox commented 2 years ago

While trying out this application and attempting to get a better understanding of how it should be used, I noticed that it exits 0 (and without any error message) if it does not find any zfs snapshots. At least, that is my interpretation based on a very quick code review - I am not very familiar with rust.

Is this intended behavior? My personal inclination is that the tool should fail in such a case. For example, if the zfs snapshot automation failed and left behind no snapshots, this tool would not generate new backups and the existing backups in S3 would eventually evaporate.

If this is unintended behavior, I would not mind taking a stab at a fix.

Thank you for publishing this tool!

andaag commented 2 years ago

Definitely unintended. This is more in the case of "100% of the zfs snapshots we found none of have been synced". So please, a PR would be welcome 👍.

Would probably make sense to give some information on what the current regex is trying to look for if we find 0 matches.

Thank you!