Skip to content

Commit ca02a51

Browse files
authored
Merge pull request #4 from qubidt/feature/dependencies-docs
2 parents 4b4da6b + 6b35a96 commit ca02a51

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ PREFIX ?= /usr
2020
SNAPPER_CONFIG ?= /etc/sysconfig/snapper
2121

2222
BIN_DIR = $(DESTDIR)$(PREFIX)/bin
23-
SYSTEMD_DIR = $(DESTDIR)$(PREFIX)/lib/systemd/system
2423
SHARE_DIR = $(DESTDIR)$(PREFIX)/share
2524

2625
.PHONY: install

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,28 @@ Starting with release 0.6, the tarballs are signed with my key with fingerprint
3939
`F7B28C61944FE30DABEEB0B01070BCC98C18BD66` ([public key]). Previous tarballs and commits
4040
used a different key with fingerprint `8535CEF3F3C38EE69555BF67E4B5E45AA3B8C5C3`.
4141

42+
## Dependencies
43+
44+
### Mandatory dependencies:
45+
46+
The dependencies below are Arch Linux package names. Packages on other distros may use different names.
47+
48+
* bash
49+
* btrfs-progs
50+
* coreutils (for `cat`/`cp`/`sync`)
51+
* gawk
52+
* grep
53+
* snapper
54+
* util-linux (for `findmnt`)
55+
56+
### Optional dependencies:
57+
58+
* libnotify (for desktop notifications)
59+
* openssh (for remote backups)
60+
* pv (for progress bar during backup)
61+
* rsync (for remote backups)
62+
* sudo (for desktop notifications)
63+
4264
## Documentation
4365

4466
See `snap-sync(8)` after installation.

bin/snap-sync

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ printf "snap-sync comes with ABSOLUTELY NO WARRANTY. This is free software, and
3737
SNAPPER_CONFIG=/etc/conf.d/snapper
3838

3939
donotify=0
40-
if ! which notify-send &> /dev/null; then
40+
if ! command -v notify-send &> /dev/null; then
4141
donotify=1
4242
fi
4343

4444
doprogress=0
45-
if ! which pv &> /dev/null; then
45+
if ! command -v pv &> /dev/null; then
4646
doprogress=1
4747
fi
4848

@@ -84,7 +84,7 @@ Options:
8484
-n, --noconfirm do not ask for confirmation
8585
-k, --keepold keep old incremental snapshots instead of deleting them
8686
after backup is performed
87-
-p, --port <port> remote port; wsed with '--remote'.
87+
-p, --port <port> remote port; used with '--remote'.
8888
-q, --quiet do not send notifications; instead print them.
8989
-r, --remote <address> ip address of a remote machine to backup to
9090
--sudo use sudo on the remote machine
@@ -182,6 +182,12 @@ uuid_cmdline=${uuid_cmdline:-"none"}
182182
subvolid_cmdline=${subvolid_cmdline:-"5"}
183183
noconfirm=${noconfirm:-"no"}
184184

185+
if [[ -z $remote ]]; then
186+
if ! command -v rsync &> /dev/null; then
187+
die "--remote specified but rsync command not found"
188+
fi
189+
fi
190+
185191
if [[ "$uuid_cmdline" != "none" ]]; then
186192
if [[ -z $remote ]]; then
187193
notify_info "Backup started" "Starting backups to $uuid_cmdline subvolid=$subvolid_cmdline..."

0 commit comments

Comments
 (0)