Commit Graph

176 Commits

Author SHA1 Message Date
36964526f8 snap-sync: improve flag handling (parse_params)
- donotify
- do_pv_cmd

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2018-01-17 18:17:58 +01:00
6f05af8620 snap-sync: bug backupdir 2017-11-29 01:48:48 +01:00
660f3734c6 snap-sync: reflact snapper, call convention update
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-24 13:58:43 +01:00
ae000058ac snap-sync: improve parse_params()
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-24 13:58:43 +01:00
8a57d7807d snap-sync: 0.5.1 bump version 2017-11-22 21:59:20 +01:00
45c53b7969 TODO.md: update task list 2017-11-22 21:59:20 +01:00
3586d800ec README.md: update documentation to compley with version 0.5.1 2017-11-22 21:59:19 +01:00
3f3c38d9df snap-sync: Copyright update
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-22 21:59:19 +01:00
09d5f419a5 snap-sync: run_config() allow refine of backupdir
- 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!
2017-11-22 21:59:19 +01:00
cae12a7bcb snap-sync: get_answer_yes_no update, batch/interactive option
- rework get_answer_yes_no() with preselection value
- update parse_params to use --interactive and --batch option
  keep --noconfirm for history
2017-11-22 21:59:19 +01:00
c6de0dec80 snap-sync: introduce cleanup() function
- for trapkill: call cleanup function
- remove temp-dirs
2017-11-22 21:59:19 +01:00
eac70fc001 snap-sync: parse_params update, reduce log-entry verbosity 2017-11-22 21:59:19 +01:00
9002e502c4 snap-sync: apply snapper description variables
- destinguish three states (running, synced, finished)
- adapt handling where needed
2017-11-22 21:59:19 +01:00
e3d052dc09 snap-sync: cleanup snap_sync_options, snapper call (long option name) 2017-11-22 21:59:19 +01:00
ec4723d65d snap-sync: btrfs-send/btrfs-receive pipe handling
- 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
2017-11-22 21:59:19 +01:00
62a33aa88b snap-sync: replace 'basename' with shell inline function 2017-11-22 21:59:19 +01:00
0593b2cfb5 snap-sync: new function run_finalize()
- new function run_finalize
- tagg already synced source snapshots (description and cleanup algorithem)
2017-11-22 21:59:19 +01:00
fea12084f9 snap-sync: cleanup target snapper structure handling
- verify_snapper_structure: better variable parsing
- handle situation of deleted snapper target structure
- lineup variable names
- ensure proper sync after snapper calls
- snapper metadata updates
- support multiple config option parameter
- update dry-run processing
- refuse to backup a snapshot to the target,
  if new source snap-id already exists on target subvolume
- cleanup permission settings for backupdir
2017-11-22 21:59:19 +01:00
50680410bb snap-sync: refine target_config, target_snapshot
- cleanup variable usage
  target_config   -> target_subvol
  target_snapshot -> target_snapshots

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-22 21:59:18 +01:00
b8ed1bc2cc snap-sync: cleanup presented disk infos in selection dialog
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-22 21:59:18 +01:00
a97ff0668c snap-sync: new get_answer_yes_no(), check_snapper_failed_ids
- 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>
2017-11-22 21:59:18 +01:00
cd60b4d022 snap-sync: new cmdline-option 'backupdir'
- 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>
2017-11-22 21:59:18 +01:00
c36d92159e snap-sync: trap handling, use prinf, snapper description handling
- substitute 'echo' calls with 'printf' calls where appropriate
- prepend $progname in notify messages
- trap handling in posix form
- update snapper description on successfull backup
- usage update: introduce subvolid
- usage update: introduce -t, --target
2017-11-22 21:59:18 +01:00
fe15397f33 snap-sync: enable snapper to admin snap-sync backups on target
- 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>
2017-11-22 21:59:18 +01:00
ee1ed3b4ed TODO.md: howto support snapper handling of target synced snapshots
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-22 21:59:18 +01:00
f99b720a21 snap-sync: support selection of SUBVOLID
- either use --subvolid 'id' or --SUBVOLID 'id'
- or --subvolid='id' or --SUBVOLID='id'

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-22 21:59:18 +01:00
3033822423 snap-sync: reflact subvolid for processed snapshot backup
- 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>
2017-11-22 21:59:18 +01:00
024cfc4392 snap-sync: 0.4.4 version bump
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-22 21:59:18 +01:00
b973e3e0a8 snap-sync: support dryrun, and selection of mounted target subvolume
- 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>
2017-11-22 21:59:18 +01:00
4b6a06f885 snap-sync: 0.4.3 version bump (inital posix version)
- 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>
2017-11-22 21:59:18 +01:00
2ed161c8db snap-sync: restructure function block
- 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>
2017-11-22 21:59:17 +01:00
15a0aee30e snap-sync: new function check_prerequisites()
- check availability of referenced programs at runtime
- check if $SNAPPER_CONFIG is readable

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-22 21:59:17 +01:00
2612174cfe snap-sync: introduce function block, parse_params()
- create function block
  functions are sorted by name
- new function parse_params()
  check initial commandline  arguments and defaults
- introduce a verbose option
2017-11-22 21:59:17 +01:00
9f0524262d snap-sync: track script-name as 'progname'
- change variable 'name' to 'progname'
2017-11-22 21:59:17 +01:00
3349270546 snap-sync: cleanup trailing whitespace 2017-11-22 21:59:17 +01:00
ab8a346cf2 TODO.md: scheduler for open tasks
- structure ideas on how to improve the wrapper
- keep track on programming tasks

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-22 21:59:17 +01:00
7b16bed4ee Git: ignore reproducable contents
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-22 21:59:17 +01:00
19dc43125c snap-sync.bash: rename bash version of snap-sync to snap-sync.bash
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2017-11-22 21:59:13 +01:00
James “Wes” Barnett
aa19fcbef8 Merge pull request #57 from R1dO/fix-Makefile_systemd_service
Remove makefile systemd install target
2017-11-17 11:27:28 -05:00
R1dO
6bcc54bfd8 Remove makefile systemd install target
Fixes a ``make install`` error due to missing directory.
Caused by the systemd script removal in commit 38caa9c
2017-11-17 14:31:42 +01:00
James Barnett
0875b5e31c update documentation 2017-11-11 13:42:41 -05:00
James Barnett
efb6740dc7 add systemd example 2017-11-11 13:35:41 -05:00
James Barnett
38caa9cefa remove systemd service 2017-11-11 12:59:03 -05:00
James Barnett
52db8f099a List mounted btrfs disks with subvolid
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.
2017-11-11 11:57:49 -05:00
James Barnett
fe05b91db4 make libnotify optional 2017-11-07 13:04:01 -05:00
James Barnett
34ef2fa185 instead of deleting old snapshot, change to number algorithm and note that it can be removed 2017-08-27 17:18:45 -04:00
James Barnett
c97a99f652 version bump 2017-08-26 14:20:26 -04:00
James Barnett
c3a0ae0af1 Revert "rm old file"
This reverts commit 638c3b80e6.

Fixes #53.
2017-08-26 14:17:46 -04:00
James Barnett
217f0f1533 add SNAPPER_CONFIG 2017-08-26 06:59:25 -04:00
James Barnett
a4a6ef79a5 version bump 2017-08-23 19:36:55 -04:00