diff --git a/config b/config index ea9fe4e..774c431 100644 --- a/config +++ b/config @@ -13,7 +13,7 @@ fi # Beginning of configuration: ############################# -#BORG=$(which borg) +BORG="/usr/local/bin/borg" SYSTEM_NAME="frameless" BORG_REPO="ths.tnet.space:/mnt/data/borg/${SYSTEM_NAME}" diff --git a/install b/install index addb987..39132a7 100755 --- a/install +++ b/install @@ -1,9 +1,11 @@ #! /bin/bash +# Copy borgwrapper to bin directory cp -i ./src/borgwrapper /usr/local/bin/borgwrapper chown root. /usr/local/bin/borgwrapper chmod 750 /usr/local/bin/borgwrapper +# Make borgwrapper config directory and move config file if [ ! -d /etc/borgwrapper/ ]; then mkdir /etc/borgwrapper fi @@ -18,6 +20,7 @@ cp -i ./config /etc/borgwrapper/config chown root. /etc/borgwrapper/config chmod 600 /etc/borgwrapper/config +# Setup systemd cp ./systemd/*.{timer,service} /etc/systemd/system/ for config_file in /etc/borgwrapper/* @@ -30,7 +33,27 @@ do systemctl start borgwrapper-verify@"${config_file}".timer done +# Setup logrotate +if [ ! -d /var/log/borgwrapper ]; then + mkdir /var/log/borgwrapper +fi + +cat < /etc/logrotate/logrotate.d/borgwrapper + + + +# Done. Display some instructions. echo echo "Please edit \"/etc/borgwrapper/config\" to make changes to configuration." +echo echo "Read \"README.md\" for more information." echo +echo "Logs will be stored in \"/var/log/borgwrapper/*\"" +echo diff --git a/src/borgwrapper b/src/borgwrapper index 55f56d5..b319a75 100755 --- a/src/borgwrapper +++ b/src/borgwrapper @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="1.5.2" +VERSION="2.0" SCRIPT_NAME=$(basename $0) log () {