Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 9 additions & 3 deletions bin/snap-sync
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 <port> remote port; wsed with '--remote'.
-p, --port <port> remote port; used with '--remote'.
-q, --quiet do not send notifications; instead print them.
-r, --remote <address> ip address of a remote machine to backup to
--sudo use sudo on the remote machine
Expand Down Expand Up @@ -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..."
Expand Down