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 1b8c1fe..f9f1ff8 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,28 @@ 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: + +The dependencies below are Arch Linux package names. Packages on other distros may use different names. + +* bash +* btrfs-progs +* coreutils (for `cat`/`cp`/`sync`) +* gawk +* grep +* snapper +* util-linux (for `findmnt`) + +### Optional dependencies: + +* libnotify (for desktop notifications) +* openssh (for remote backups) +* pv (for progress bar during backup) +* rsync (for remote backups) +* sudo (for desktop notifications) + ## Documentation See `snap-sync(8)` after installation. diff --git a/bin/snap-sync b/bin/snap-sync index e50ad5e..a04471e 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 @@ -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..."