Remove .sh from config and borgwrapper

dev
hk 2018-01-30 23:51:46 +01:00
parent 48de6e889c
commit 6e3f74e03f
5 changed files with 14 additions and 14 deletions

View File

@ -2,24 +2,24 @@
Wrapper to simplify backups with borgbackup Wrapper to simplify backups with borgbackup
# Installation # Installation
Put the [script](src/borgwrapper.sh) somewhere practical Put the [script](src/borgwrapper) somewhere practical
cp borgwrapper.sh /usr/local/bin/borgwrapper cp borgwrapper /usr/local/bin/borgwrapper
chown root. /usr/local/bin/borgwrapper chown root. /usr/local/bin/borgwrapper
chmod 750 /usr/local/bin/borgwrapper chmod 750 /usr/local/bin/borgwrapper
# Configuration # Configuration
By default borgwrapper expects the configuration to be located at `/etc/borgwrapper/config.sh`. By default borgwrapper expects the configuration to be located at `/etc/borgwrapper/config`.
An example configuration file is included in [config.sh.example](src/config.sh.example). An example configuration file is included in [config.example](src/config.example).
Ensure restrictive permissions on this file as it exposes the passphrase. Ensure restrictive permissions on this file as it exposes the passphrase.
chown root. config.sh chown root. config
chmod 600 config.sh chmod 600 config
# Scheduling # Scheduling
## systemd ## systemd
Copy the example systemd [unit files](systemd/) to `/etc/systemd/system/`. Then for each Copy the example systemd [unit files](systemd/) to `/etc/systemd/system/`. Then for each
configuration file in `/etc/borgwrapper/<config_name>.sh` do: configuration file in `/etc/borgwrapper/<config_name>` do:
systemctl enable borgwrapper-backup@<config_name>.timer systemctl enable borgwrapper-backup@<config_name>.timer
systemctl enable borgwrapper-verify@<config_name>.timer systemctl enable borgwrapper-verify@<config_name>.timer
@ -89,5 +89,5 @@ Run in subshell if you do not want the passphrase stored in the current shell af
Examples: Examples:
(. /etc/borgwrapper/config.sh; export BORG_PASSPHRASE; borg mount "$BORG_REPO" /mnt) (. /etc/borgwrapper/config; export BORG_PASSPHRASE; borg mount "$BORG_REPO" /mnt)
(. /etc/borgwrapper/config.sh; export BORG_PASSPHRASE; borg list "$BORG_REPO") (. /etc/borgwrapper/config; export BORG_PASSPHRASE; borg list "$BORG_REPO")

View File

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
VERSION="1.3.0" VERSION="1.4.0"
print_usage () { print_usage () {
cat << EOF cat << EOF
Usage: $(basename "${BASH_SOURCE[0]}") [OPTIONS] MODE Usage: borgwrapper [OPTIONS] MODE
OPTIONS OPTIONS
-c CONFIG_FILE -c CONFIG_FILE
@ -170,7 +170,7 @@ exit_clean () {
# Default parameters # Default parameters
CONFIG="/etc/borgwrapper/config.sh" CONFIG="/etc/borgwrapper/config"
DRY_RUN=false DRY_RUN=false
BORG="/usr/bin/borg" BORG="/usr/bin/borg"
LOCKDIR="/run/lock/borgwrapper" LOCKDIR="/run/lock/borgwrapper"

View File

@ -4,7 +4,7 @@ After=network.target
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=/usr/local/bin/borgwrapper -c /etc/borgwrapper/%i.sh backup ExecStart=/usr/local/bin/borgwrapper -c /etc/borgwrapper/%i backup
Nice=10 Nice=10
User=root User=root
Group=root Group=root

View File

@ -4,7 +4,7 @@ After=network.target borgwrapper-backup@%i.service
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=/usr/local/bin/borgwrapper -c /etc/borgwrapper/%i.sh verify ExecStart=/usr/local/bin/borgwrapper -c /etc/borgwrapper/%i verify
Nice=10 Nice=10
User=root User=root
Group=root Group=root