Commit Graph

275 Commits

Author SHA1 Message Date
Jim Salter ef601eb96b Merge branch 'master' of https://github.com/jimsalterjrs/sanoid 2022-04-08 21:34:58 +00:00
Jim Salter ee8c884460 put local resume token support back in 2022-04-08 21:34:01 +00:00
Jim Salter b0a71f763a
Merge pull request #734 from Gryd3/patch-1
append a rand int to the socket name.
2022-04-08 17:18:23 -04:00
Jim Salter ef2b4f887a no more rolling targets back, receive -F only 2022-04-08 21:09:51 +00:00
Jim Salter ec7858c1c7 don't use resume tokens for purely local replication 2022-04-08 20:57:53 +00:00
Gryd3 b1c2684c63
append a rand int to the socket name.
Running more than one 'syncoid' at the same time to the same host resulted in two jobs referencing the same socket.
Often results in "already exists, disabling multiplexing" but has in more than one occasion failed with the following:

ControlSocket /tmp/syncoid-zfsbackup-zfsbackup@10.0.0.1-1649107066 already exists, disabling multiplexing
lzop: Inappropriate ioctl for device: <stdin>
CRITICAL ERROR: ssh     -S /tmp/syncoid-zfsbackup-zfsbackup@10.0.0.1-1649107066 zfsbackup@10.0.0.1 ' zfs send  -I '"'"'pool/office'"'"'@'"'"'autosnap_2022-04-04_21:00:00_frequently'"'"' '"'"'pool/office'"'"'@'"'"'autosnap_2022-04-04_21:15:00_frequently'"'"' | lzop  | mbuffer -R 5m -q -s 128k -m 16M 2>/dev/null' | mbuffer  -q -s 128k -m 16M 2>/dev/null | lzop -dfc | pv -s 18356312 |  zfs receive  -s -F 'zfs-pool/vault/office' 2>&1 failed: 256 at /usr/sbin/syncoid line 786.

Sample use-case: 
Using Monit, Cron, or some other scheduler to trigger more than syncoid to the same host to sync two datasets.
Stagger the sync so that no two jobs get started at the same time, or add some form of randomization to the socket name so that two jobs may start at the same time.
2022-04-04 15:00:31 -07:00
Christoph Klaffl 77d0135a60
prepare v2.1.0 release 2020-11-24 11:52:20 +01:00
Christoph Klaffl 2da9ba2095
only preserve recordsize for datasets of type "filesystem" 2020-11-03 18:05:13 +01:00
Christoph Klaffl bdd0dfb733
Merge branch 'master' into preserve-recordsize 2020-11-03 17:50:50 +01:00
Jim Salter 59e8949efe
Merge pull request #498 from phreaker0/syncoid-dst-fix
append timezone offset to the syncoid snapshot name to fix DST collis…
2020-11-01 17:46:32 -05:00
Jim Salter 14e6c62d0a
Merge pull request #508 from phreaker0/check-arguments
check for an invalid argument combination
2020-11-01 17:24:29 -05:00
Jim Salter 42ea8dffce
Merge pull request #507 from phreaker0/fix-busy-detection
fix iszfsbusy check for similar dataset names
2020-11-01 17:24:20 -05:00
Jim Salter 345e7e58b5
Merge pull request #374 from aerusso/pulls/syncoid-dont-require-user
Do not require user to be specified for syncoid
2020-11-01 17:22:57 -05:00
Jim Salter f187e072b8
Merge pull request #529 from phreaker0/root-resume-check
use sudo if neccessary for checking pool capabilities regarding resum…
2020-11-01 17:19:50 -05:00
Jim Salter c21b72a376
Merge pull request #510 from phreaker0/reset-resume-2
catch another case in which the resume state isn't availabe anymore
2020-11-01 17:19:22 -05:00
Jim Salter 0ac10750a7
Merge pull request #536 from phreaker0/keep-sync-snap
implemented option for keeping sync snaps
2020-11-01 17:19:00 -05:00
Antonio Russo f397687968
Do not require user to be specified for syncoid
Extends syncoid remote capabilities to match that of ssh as closely as
possible: allow a remote dataset to be specified without a username.

 - Detect if a remote reference is possible by looking for a : before
   any / characters.
 - Check if there are any pool names that might conflict with this
   name. E.g., 'weird:symbol/ds' might refer to the pool "symbol" on
   host "weird", and dataset ds. OR it might refer to the local pool
   "weird:symbol" and dataset ds.
 - Prefer local pools, matching existing behavior. No preexisting
   functioning configurations will break.
 - The name of the control socket is changed slightly.
 - A bug in the handling of remote datasets with colons in the name
   is addressed.

Signed-off-by: Antonio Russo <aerusso@aerusso.net>
2020-11-01 10:55:50 -07:00
jimsalterjrs 9544ea7e6a typo in syncoid help 2020-05-23 16:27:29 -04:00
Christoph Klaffl 9ab57e9bb4
added documentation regarding --keep-sync-snap option 2020-05-01 17:26:54 +02:00
Christoph Klaffl d77cfdf4c7
implemented option for keeping sync snaps 2020-05-01 17:20:07 +02:00
Christoph Klaffl 0e807386c4
use sudo if neccessary for checking pool capabilities regarding resumeable send 2020-04-20 19:20:28 +02:00
Christoph Klaffl b808a74e2e
catch another case were the resume state isn't availabe anymore 2020-02-14 18:38:38 +01:00
Christoph Klaffl 4ebdc9d173
check for an invalid argument combination 2020-02-13 18:31:56 +01:00
Christoph Klaffl 13ba2b43fa
fix iszfsbusy check for similar dataset names 2020-02-13 01:37:54 +01:00
Christoph Klaffl 1bad3cd25b
append timezone offset to the syncoid snapshot name to fix DST collisions 2020-02-12 18:24:08 +01:00
croadfeldt bb30496d19
Fixed Typo in arguments.
Removed errant A in zfs list command line arguments.
2020-01-18 01:52:12 -06:00
Christoph Klaffl d0ef3ec2d5
Merge branch 'master' into preserve-recordsize 2020-01-16 21:23:07 +01:00
Jim Salter e5c998c71d
Merge pull request #408 from gdevenyi/pvoptions
add ability to configure pv in syncoid
2020-01-16 13:57:10 -05:00
Jim Salter e031976cde
Merge pull request #415 from phreaker0/send-size-adaption
added needed verbose flag for send size estimation (at least for late…
2020-01-16 13:50:57 -05:00
Jim Salter 69d6ae21d7
Merge pull request #383 from mschout/feature/ignore-missing-filesystems
Gracefully handle error when source dataset disappeared
2020-01-16 13:47:09 -05:00
Christoph Klaffl 28ef311ba5
only print stderr output of failed listing command with --debug flag 2020-01-16 18:10:20 +01:00
Christoph Klaffl 3b18948f29
typo 2020-01-16 17:49:43 +01:00
Christoph Klaffl 77fd555a84
fixed state reset 2020-01-16 01:26:44 +01:00
Christoph Klaffl 30fb5aabeb
implemented fallback for listing snapshots on solaris 2020-01-13 19:25:22 +01:00
Christoph Klaffl 96a48efd92
prepare v2.0.3 bugfix release 2019-10-02 16:42:38 +02:00
Christoph Klaffl b04bd2f02d
proper changelog for the last two version and packaging updates 2019-09-25 22:22:00 +02:00
Christoph Klaffl 381560a320
documented preserve-recordsize flag 2019-09-25 18:33:55 +02:00
Christoph Klaffl a9043b5301
implemented flag for preserving recordsize on inital sends 2019-09-25 18:24:40 +02:00
Christoph Klaffl a85ad93a18
added needed verbose flag for send size estimation (at least for latest FreeBSD codebase) 2019-06-18 08:32:11 +02:00
Gabriel A. Devenyi dee9d1817f Add ability to configure pv 2019-06-14 11:50:34 -04:00
Jim Salter a90eec33e3
Merge pull request #405 from hartzell/patch-1
Documentation buglet, --sshkey specifies the *key*
2019-06-14 10:11:19 -04:00
Christoph Klaffl 9791094816
some FreeBSD related fixes 2019-06-14 15:45:44 +02:00
George Hartzell cb94fa1d16
Documentation buglet, --sshkey specifies the *key*
The `--sshkey` option specifies the ssh key, *not* the ssh public key.  Empirically, it fails if you point it at a public key and works if you point it at the private part.  Make sense since it's being used as the arg to `-i` in the `ssh` command line.
2019-06-13 14:34:08 -07:00
Christoph Klaffl 56f97b5bd2
capture the stderr of zfs send command in the case of a resumed replication where the send size can't be estimated (in which case pv is not working anyway, so we can break the interactivitiy) 2019-06-06 08:09:42 +02:00
Christoph Klaffl 22fe41cb11
redirect zfs receive error to stdout and only capture stdout for parsing of error codes, this way stderr is left alone and pv can work interactively 2019-06-06 08:04:00 +02:00
Michael Schout 3892d73594 Capture output in getzfsvalue and handle datasets that disappeared
Change getzfsvalue() so that if called in array context, returns the
value and the error as a two element list.  This allows the caller to
recieve the error from the zfs command.

If the dataset went away before fetching the sanoid:sync property, just
issue a warning and skip it.
2019-05-29 17:13:31 -05:00
Michael Schout 784efe2d85 Remove debug warning 2019-05-25 12:01:54 -05:00
Michael Schout fd71e794ad Gracefully handle error when source dataset disappeared
If the source dataset dissappeared before we were able to get the
sanoid:sync property, do not set an error exit code.  Handle this
gracefully as this should not be considered an error.

Fixes #380
2019-05-25 12:01:54 -05:00
Christoph Klaffl 6eb1be3ef7
handle resume states where the source snapshot was already deleted 2019-05-20 18:18:21 +02:00
Christoph Klaffl 16fceba54c
moved common used variables to top of function 2019-05-20 18:01:29 +02:00