- harden testings when creating snapper structure on target
- reorder function get_config
- remove tee to PIPE
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- when creating a snapper structure on target system
use the defined snap-sync template (default search-path /etc/snapper/config-templates)
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- in interactive mode: ask user to change/keep given backupdir
- introduce get_config()
get value from key/value pair in targets snapper config file
- introduce set_config()
update key/value pair in targets snapper config file
- use BTRFS_PIPE to redirect btrfs messages. Rely on retrun status
anything >0 signals a pipe error!
- snapper is using hardcoded subvolume name to store its ro snapshots
variable snapper_snapshots holds it (.snapshots)
- new optional progress visualiation (via pv)
- more robust error handling
rely on btrfs-send/btrfs-receive exit code
- function get_answer_yes_no(): dialog requesting user feedback
- function check_snapper_failed_ids(): call cleanup as needed
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- predefine a backupdir. This path is relative to the backup_root.
It will be created as a subdirectory on target disk if necessary.
- parse_params(): accept lowercase option --target, --uuid
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- create and verify snapper compatible structure on target host
- create snapper config (snap-$selected_config) on target host
if not already available. use a snap-sync template.
- change userdata for snapper listings on target config
subvolid, uuid and hostname reflact the values from the source system
- introduce a snapper template (/etc/snapper/config-templates/snap-sync)
- adapt Makefile to support an initial snap-sync template
per default, this templates excludes snap-sync backup configs
from timeline and cleanup tasks
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- snapper_sync_id should take into account the selected_subvolid
in combination with the selected_uuid
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- introduce commandline option --dry-run
perform a trial run where no changes are made.
- introduce option --TARGET
Specify the mountpoint of the BTRFS subvolume to back up to.
This makes it possible, to have multiple subvolumes on target disks,
and select them as needed to store backup configurations.
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- use dash as reference shell
- refine all bashism to posix calls
- convert bash arrays to posix "pseudo arrays"
yes, posix does not support handy arrays
- introduce global/local variables
- using (hopefully) more descriptive variable names
- new function verify_snapper_structure()
that takes care to construct target snapper file-structure
as needed
- 0.4.3 bump version
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- new function get_disk_info()
- new function run_config()
- new function run_backup()
- new function get_target_disk()
- apply them to be in lexical order
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- create function block
functions are sorted by name
- new function parse_params()
check initial commandline arguments and defaults
- introduce a verbose option
When listing mounted devices, list the subvolid of the mountpoint, since
a single btrfs disk can be mounted multiple times using subvolumes.
Additionally tag snapshots with subvolid to keep track of this. This
will break current usage, but users can manually tag old snapshots with
subvolid's in order to migrate them. Add -s/--subvolid command line
parameter to pass specified subvolid to program.
Cf. #45.