uptate install script to display progress

master
Bryan 2020-11-04 23:40:36 -06:00
parent 6bf22c3189
commit 7ef6745ec5
1 changed files with 12 additions and 2 deletions

10
install
View File

@ -1,11 +1,13 @@
#! /bin/bash
# Copy borgwrapper to bin directory
echo "Installing borgwrapper in: /usr/local/bin/"
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
echo "Making directory: /etc/borgwrapper"
if [ ! -d /etc/borgwrapper/ ]; then
mkdir /etc/borgwrapper
fi
@ -16,13 +18,17 @@ if [ ! -e ./config ]; then
exit 1
fi
echo "Copying config to: /etc/borgwrapper/config"
cp -i ./config /etc/borgwrapper/config
chown root. /etc/borgwrapper/config
chmod 600 /etc/borgwrapper/config
# Setup systemd
echo "Setting up systemd"
echo "Copying systemd timer and service unit files to: /etc/systemd/system/"
cp ./systemd/*.{timer,service} /etc/systemd/system/
echo "Enabling and starting backup and verify systemd timer units"
for config_file in /etc/borgwrapper/*
do
config_file=$(basename ${config_file})
@ -34,10 +40,13 @@ do
done
# Setup logrotate
echo "Setting up logrotate for borgwrapper log files"
echo "Creating directory: /var/log/borgwrapper/"
if [ ! -d /var/log/borgwrapper ]; then
mkdir /var/log/borgwrapper
fi
echo "Creating logrotate file: /etc/logrotate.d/borgwrapper"
(
cat <<EOF
/var/log/borgwrapper/borgwrapper.log {
@ -55,6 +64,7 @@ EOF
# Done. Display some instructions.
echo
echo "Please edit \"/etc/borgwrapper/config\" to make changes to configuration."
echo "You may have multiple configuration files. Please read documentation."
echo
echo "Read \"README.md\" for more information."
echo