5
0
mirror of git://git.proxmox.com/git/pve-zsync.git synced 2025-01-03 09:17:37 +03:00
Commit Graph

153 Commits

Author SHA1 Message Date
Thomas Lamprecht
4941b10d2a man/pod: move full synopsis below description
so that people get to read a short description before viewing the
rather large full command and option synopsis.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-04 14:35:36 +02:00
Thomas Lamprecht
205d6d8f73 docs: use standard long-opt double --arg
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-04 14:23:35 +02:00
Thomas Lamprecht
ee8772ead8 avoid odd post-if style for die
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-04 12:13:34 +02:00
Thomas Lamprecht
d4775ec3e9 fix a variable declared in conditional statement
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-04 12:13:18 +02:00
Fabian Ebner
316d63e9c7 fix #1669: add prepend-storage-id flag
so one can set up jobs for guests with disks with the same name on different
storages. For example,
    storageA:vm-123-disk-0
    storageB:vm-123-disk-0
will be synced to
    target/storageA/vm-123-disk-0
    target/storageB/vm-123-disk-0
when the flag is specified.

The necessary parent file systems (one per storage ID) are created as needed.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-04 12:12:51 +02:00
Fabian Ebner
e2c374ad77 parse disks: also include storage ID information
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-04 12:12:51 +02:00
Fabian Ebner
0eb3ecdcf4 parse disks: don't include colon in storage name variable
in preparation to re-use it elsewhere.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-04 12:12:51 +02:00
Fabian Ebner
728a642c53 add create_file_system function
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-04 12:12:51 +02:00
Fabian Ebner
1ae8a2136d add check_dataset_exists function
as a generalization and replacement of check_pool_exists.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-04 12:12:51 +02:00
Fabian Ebner
5a0499c91f add target_dataset function
so the logic can be re-used and extended in a single place.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-04 12:12:51 +02:00
Fabian Ebner
b6fe42059f usage: fix type for maxsnap
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-04 12:12:51 +02:00
Fabian Ebner
53e7ea54e0 usage: describe flag parameters correctly
It's not possible to provide a false value. From the documentation for
GetOptionsFromArray:
    The argument specification is optional. If omitted, the option is considered
    boolean, a value of 1 will be assigned when the option is used on the
    command line.

Make it clear that specifying the flag alone already enables it.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-04 12:12:51 +02:00
Fabian Ebner
5f1187c6c0 copyright: update year
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-04 12:12:51 +02:00
Fabian Ebner
1804631943 whitespace fix
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-05-04 12:12:51 +02:00
Fabian Ebner
5bf0bc3569 fix #2821: only abort if there really is a waiting/syncing job
by remembering the process via PID+start time+boot ID and checking for that
information in the new instance. If the old instance can't be found, the new
one will continue and register itself in the state.

After updating the pve-zsync package, if there is a waiting instance running the
old version, one more might be created, because there is no instance_id yet. But
the new instance will set the instance_id, which any later instance will see.

More importantly, if the state is wrongly 'waiting' or 'syncing', i.e.
because an instance was terminated before finishing, we don't abort anymore and
recover from the wrong state, thus fixing the bug.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-12-18 17:41:18 +01:00
Fabian Ebner
d01b047d26 introduce and use read_file helper
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-12-18 17:41:18 +01:00
Fabian Ebner
f06c336b2a remove unused function write_cron
Commit 76b2c677f7 replaced it with
update_cron.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-12-18 17:41:18 +01:00
Dietmar Maurer
39b7694870 bump version to 2.0-4 2020-11-26 05:57:22 +01:00
Bruce Wainer
5d3ff0f6e4 pve-zsync: Flip Source and Dest in functions to so jobs can share Dest
Signed-off-by: Bruce Wainer <brwainer@gmail.com>
Tested-by: Wolfgang Link <w.link@proxmox.com>
Reviewed-by: Wolfgang Link <w.link@proxmox.com>
2020-06-24 11:19:17 +02:00
Thomas Lamprecht
b6f6f505ec bump version to 2.0-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-23 18:37:30 +01:00
Wolfgang Link
3423ce79c6 check for correct incremental sync snapshot on destination
For an incremental sync you need the last_snap on both sides. The
call to the zfs list contains the snapshot. If the snapshot does not
exist, the command is returned with an error that we are catching.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
Reviewed-By: Fabian Ebner <f.ebner@proxmox.com>
Tested-By: Fabian Ebner <f.ebner@proxmox.com>
2020-03-19 13:02:14 +01:00
Thomas Lamprecht
fd8052006b Revert "fix: check for incremental sync snapshot."
This reverts commit 723623e885.
2020-03-19 13:02:02 +01:00
Wolfgang Link
723623e885 fix: check for incremental sync snapshot.
For an incremental sync you need the last_snap on both sides.
2020-03-19 12:32:41 +01:00
Thomas Lamprecht
7d26f2a90d bump version to 2.0-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-27 18:48:10 +01:00
Fabian Ebner
07f255cdf9 Add efidisk as a valid disk key
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-01-27 18:42:05 +01:00
Fabian Ebner
e45536e551 Factor out the regular expression for disk keys as a variable
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-01-27 18:42:05 +01:00
Thomas Lamprecht
a6117db573 refactor cleanup code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-11 12:08:14 +02:00
Fabian Ebner
98b556b61c Check whether job has been disabled while waiting/syncing
There are two new checks that allow disabling a job while
it is 'syncing' or 'waiting'. Previously when sync finished
it would re-enable such a job involuntarily.
Disabling a 'waiting' job causes it to not sync anymore.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2019-10-11 11:51:16 +02:00
Fabian Ebner
8ab5db491f Detect other running instances of the same job
A 'waiting' state is introduced and other 'waiting' and 'syncing'
instances of the same job are now detected by moving the check out
from the sync lock.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2019-10-11 11:51:16 +02:00
Fabian Ebner
af5cd408b0 Improve read-modify-write enclosures
Previously inside sync we just called update_job directly, now
we make sure to read the latest verison of the job first.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2019-10-11 11:51:16 +02:00
Fabian Ebner
96ed817693 Refactor locking
This introduces a new locked() mechanism allowing to enclose locked
sections in a cleaner way. There's only two types of locks namely one
for state and cron (they are always read together and almost always
written together) and one for sync.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2019-10-11 11:51:16 +02:00
Thomas Lamprecht
f1616f20eb buildsys: switch upload dist over to buster
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-23 18:18:32 +02:00
Thomas Lamprecht
fafe736a7f bump version to 2.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-23 17:46:52 +02:00
Thomas Lamprecht
5058ccf18c buildsys: use dpkg-dev makefile helpers for pkg info
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-23 17:42:54 +02:00
Thomas Lamprecht
9749f08ffc bump version to 1.7-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-04 16:30:34 +02:00
Mira Limbeck
7ee3e8e09b close #1933: add -dest-config-path option
this allows the config dir to be set on the destination target. this can
be useful if the default path in $CONFIG_PATH (/var/lib/pve-zsync) is not
persistent. the option is optional and falls back to $CONFIG_PATH if not
specified.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2019-04-04 16:29:13 +02:00
Thomas Lamprecht
37bdf05344 send_config: small code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-01 16:27:22 +02:00
Thomas Lamprecht
627130a216 buildsys: add dsc target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-31 15:52:20 +02:00
Thomas Lamprecht
eb91dbe4b3 bump version to 1.7-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-07 12:05:03 +01:00
Thomas Lamprecht
8e9ef0caac allow to set DEBUG over environment and load Data::Dumper conditionally
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-07 12:05:03 +01:00
Thomas Lamprecht
61ed255c3a improve signal handler, print error
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-07 12:05:03 +01:00
Thomas Lamprecht
4fec932c7d replace File::Copy::move with built-in rename
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-07 12:05:03 +01:00
Thomas Lamprecht
cd9247d50b followup: pass properties without value
our GetOPts definition of it does not defines a value, so use it as
boolean flag like 'verbose' and either pass ther param or not.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-07 12:05:03 +01:00
Wolfgang Link
70253912d0 Fix #1381: add flag allowing one to send zfs properties
Add properties flag for including the properties in the send stream.

With the flag, we do not break the current behavior and give the user
who like to sync their properties the possibility to do so.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-07 12:04:08 +01:00
Thomas Lamprecht
942049e6ed bump version to 1.7-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 15:10:43 +01:00
Thomas Lamprecht
4fe8bd742e vm_exists: directly check if we look for local guest
no need to make a call to ls if we just can check directly..

also remove a (possible problematic)
> my $foo = 'bar' if $boolean;
construct

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-20 15:46:25 +01:00
Thomas Lamprecht
9039b8bf87 fix #1587: sync: check if job state is defined
just because the $job hash is populated it's state key doesn't needs
to be..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-20 15:46:25 +01:00
Thomas Lamprecht
c9e2de9409 fix another case where source-user was used to connect to dest
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-17 15:35:24 +01:00
Thomas Lamprecht
d034d43881 fix a case where source-user was used to connect to dest
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-17 15:26:11 +01:00
David
f219b8fd1b fix #1907: cron entry duplicated on disable/enable
match the interval in front of the first root

Signed-off-by: David <d.limbeck@proxmox.com>
2018-09-18 10:07:57 +02:00