-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbak
More file actions
executable file
·28 lines (28 loc) · 768 Bytes
/
bak
File metadata and controls
executable file
·28 lines (28 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# vi:et lbr noet sw=2 ts=2 tw=79 wrap
# SPDX-FileCopyrightText: 2016-2025 David Rabkin
# SPDX-License-Identifier: 0BSD
#
# Makes incremental backups from the first parameter to the second.
# shellcheck disable=SC1091,SC2034 # File not following, appears unused.
readonly \
BASE_APP_VERSION=0.9.20250609 \
BASE_MIN_VERSION=0.9.20231212
. base.sh
[ "$#" -eq 2 ] || die bak: try bak [source directory] [destination directory]
readonly \
DST="$2" \
SRC="$1"
validate_cmd rdiff-backup
isreadable "$SRC" || die "$SRC" is not readable.
iswritable "$DST" || die "$DST" is not writable.
{
rdiff-backup \
--force \
--preserve-numerical-ids \
--print-statistics \
--terminal-verbosity 4 \
"$SRC" "$DST" \
2>&1 1>&3 3>&- | tologe
} \
3>&1 1>&2 | tolog