jimsalterjrs / sanoid

These are policy-driven snapshot management and replication tools which use OpenZFS for underlying next-gen storage. (Btrfs support plans are shelved unless and until btrfs becomes reliable.)
http://www.openoid.net/products/
GNU General Public License v3.0
3.13k stars 308 forks source link

--config-dir should be --config-file #669

Open fubar-1 opened 3 years ago

fubar-1 commented 3 years ago

Feel free to close this bug this is only a suggestion but personally I don't like the --config-dir option where you need to specify a folder where to find sanoid.conf. A much better option would be to simply change this (or add the option) to specify --config-file which would be the config file that sanoid would use to pick up it's configuration settings. This would enable the user to more easily set up multiple configurations and use the same default file (when desired) Probably the least intrusive way to implement this would be to leave the --config-dir option alone and just add a --config-file parameter for those who wish to use it that way while not breaking scripts that use the --config-dir method.

tschoening81 commented 2 months ago

Being able to provide a file instead of a dir would improve my use-case as well: I have multiple ZFS-pools in the host for NVMEs+SSDs+HDDs and an additional one at an external USB backup disk. I want regular snapshots for internal storage and regular snapshots for the backups, but with a different retention policy and trigger. The backup is simply based on using RSYNC to copy things around and I would like to trigger Sanoid manually with a special backup-specific config file totally ignoring that targeting the internal storage. The benefit simply is that Sanoid already implements all the retention stuff I need for backups as well, so no need to implement it elsewhere.

To do so currently, one needs to create an additional directory underneath e.g. /etc/sanoid/ instead of just putting an additional file into the same directory and decide later which one to use.