rclone: Make role more modular
This commit is contained in:
parent
c3497c2440
commit
338f4e2f0d
4 changed files with 42 additions and 29 deletions
|
@ -3,13 +3,19 @@
|
|||
set -eu
|
||||
umask 027
|
||||
|
||||
TARGET="/srv/backup"
|
||||
CONFIG="/etc/rclone/rclone.conf"
|
||||
LOGDIR="/var/log/rclone"
|
||||
SERVICE="$(whoami)"
|
||||
|
||||
TARGET="/srv/${SERVICE}"
|
||||
CONFIG="/etc/rclone/${SERVICE}.conf"
|
||||
LOGDIR="/var/log/rclone/${SERVICE}"
|
||||
RCLONE="/usr/local/bin/rclone"
|
||||
|
||||
timestamp="$(date +%Y%m%d%H%M%S)"
|
||||
|
||||
if [ ! -f "$CONFIG" ]; then
|
||||
echo "ERR: Config file '${CONFIG}' does not exist" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d "$TARGET" ]; then
|
||||
echo "ERR: Destination directory '${TARGET}' does not exist" 1>&2
|
||||
exit 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue