From 50c6cea9360be0dd76ee8663d2a4dbdbc85e69fc Mon Sep 17 00:00:00 2001 From: Peter Wedder Date: Sun, 24 Jan 2021 16:48:09 +0200 Subject: [PATCH 1/7] Add dependencies to readme --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 1b8c1fe..0223694 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,23 @@ Starting with release 0.6, the tarballs are signed with my key with fingerprint `F7B28C61944FE30DABEEB0B01070BCC98C18BD66` ([public key]). Previous tarballs and commits used a different key with fingerprint `8535CEF3F3C38EE69555BF67E4B5E45AA3B8C5C3`. +## Dependencies + +### Mandatory dependencies: + +* bash +* snapper +* btrfs-progs +* awk +* util-linux +* sed +* openssh-clients + +### Optional dependencies: + +* pv +* notify-send + ## Documentation See `snap-sync(8)` after installation. From 4cce6ac6948ba764f223f40ad0989043df305a28 Mon Sep 17 00:00:00 2001 From: Peter Wedder Date: Sun, 24 Jan 2021 16:50:31 +0200 Subject: [PATCH 2/7] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0223694..c1f62fb 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,8 @@ used a different key with fingerprint `8535CEF3F3C38EE69555BF67E4B5E45AA3B8C5C3` ### Optional dependencies: -* pv -* notify-send +* pv (for progress bar during backup) +* notify-send (for desktop notifications) ## Documentation From f803ebbe8c1b32769fe35b0b0d27827c21d14138 Mon Sep 17 00:00:00 2001 From: Peter Wedder Date: Sun, 31 Jan 2021 18:20:30 +0200 Subject: [PATCH 3/7] Update README.md --- README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c1f62fb..49de2e8 100644 --- a/README.md +++ b/README.md @@ -43,18 +43,25 @@ used a different key with fingerprint `8535CEF3F3C38EE69555BF67E4B5E45AA3B8C5C3` ### Mandatory dependencies: +The dependencies below are Arch Linux package names. Packages on other distros may use different names. + * bash -* snapper * btrfs-progs -* awk +* coreutils +* gawk +* grep +* snapper +* systemd * util-linux -* sed -* openssh-clients +* which ### Optional dependencies: +* libnotify (for desktop notifications) +* openssh (for remote backups) * pv (for progress bar during backup) -* notify-send (for desktop notifications) +* rsync (for remote backups) +* sudo (for desktop notifications) ## Documentation From 47156ff4ca2b61c44d10730351d86c80791fd24d Mon Sep 17 00:00:00 2001 From: Bao Trinh Date: Sun, 13 Feb 2022 19:15:19 -0600 Subject: [PATCH 4/7] remove dependency on which --- README.md | 1 - bin/snap-sync | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 49de2e8..13b2002 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,6 @@ The dependencies below are Arch Linux package names. Packages on other distros m * snapper * systemd * util-linux -* which ### Optional dependencies: diff --git a/bin/snap-sync b/bin/snap-sync index e50ad5e..cff6461 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -37,12 +37,12 @@ printf "snap-sync comes with ABSOLUTELY NO WARRANTY. This is free software, and SNAPPER_CONFIG=/etc/conf.d/snapper donotify=0 -if ! which notify-send &> /dev/null; then +if ! command -v notify-send &> /dev/null; then donotify=1 fi doprogress=0 -if ! which pv &> /dev/null; then +if ! command -v pv &> /dev/null; then doprogress=1 fi From 7b84b037504b1fd5a25e77baf63ae7f23ab3c500 Mon Sep 17 00:00:00 2001 From: Bao Trinh Date: Sun, 13 Feb 2022 19:17:34 -0600 Subject: [PATCH 5/7] check for rsync at runtime --- bin/snap-sync | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/snap-sync b/bin/snap-sync index cff6461..a04471e 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -84,7 +84,7 @@ Options: -n, --noconfirm do not ask for confirmation -k, --keepold keep old incremental snapshots instead of deleting them after backup is performed - -p, --port remote port; wsed with '--remote'. + -p, --port remote port; used with '--remote'. -q, --quiet do not send notifications; instead print them. -r, --remote
ip address of a remote machine to backup to --sudo use sudo on the remote machine @@ -182,6 +182,12 @@ uuid_cmdline=${uuid_cmdline:-"none"} subvolid_cmdline=${subvolid_cmdline:-"5"} noconfirm=${noconfirm:-"no"} +if [[ -z $remote ]]; then + if ! command -v rsync &> /dev/null; then + die "--remote specified but rsync command not found" + fi +fi + if [[ "$uuid_cmdline" != "none" ]]; then if [[ -z $remote ]]; then notify_info "Backup started" "Starting backups to $uuid_cmdline subvolid=$subvolid_cmdline..." From 0d81edbc2f3da097b1f520515e98f88847b05262 Mon Sep 17 00:00:00 2001 From: Bao Trinh Date: Sun, 13 Feb 2022 19:29:24 -0600 Subject: [PATCH 6/7] remove unecessary systemd dependency --- Makefile | 1 - README.md | 1 - 2 files changed, 2 deletions(-) diff --git a/Makefile b/Makefile index e8d9905..10463c3 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,6 @@ PREFIX ?= /usr SNAPPER_CONFIG ?= /etc/sysconfig/snapper BIN_DIR = $(DESTDIR)$(PREFIX)/bin -SYSTEMD_DIR = $(DESTDIR)$(PREFIX)/lib/systemd/system SHARE_DIR = $(DESTDIR)$(PREFIX)/share .PHONY: install diff --git a/README.md b/README.md index 13b2002..261e522 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,6 @@ The dependencies below are Arch Linux package names. Packages on other distros m * gawk * grep * snapper -* systemd * util-linux ### Optional dependencies: From 6b35a96b95d249800ed5f96d709b721ad98195ba Mon Sep 17 00:00:00 2001 From: Bao Trinh Date: Sun, 13 Feb 2022 19:39:06 -0600 Subject: [PATCH 7/7] document commands provided by dependencies --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 261e522..f9f1ff8 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,11 @@ The dependencies below are Arch Linux package names. Packages on other distros m * bash * btrfs-progs -* coreutils +* coreutils (for `cat`/`cp`/`sync`) * gawk * grep * snapper -* util-linux +* util-linux (for `findmnt`) ### Optional dependencies: