web-logs: Use logsync user for syncing logs

This commit is contained in:
Timo Makinen 2021-09-19 15:00:58 +00:00
parent 663038ced2
commit 283a16a97b
2 changed files with 27 additions and 7 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh
set -u
umask 022
umask 027
TARGET="/var/cache/sync-http-logs"
CONFIG="/etc/rclone/rclone.conf"
@ -10,6 +10,11 @@ RCLONE="/usr/local/bin/rclone"
timestamp="$(date +%Y%m%d%H%M%S)"
if [ "$(whoami)" != "logsync" ]; then
echo "ERR: Script needs to be run as logsync user" 1>&2
exit 1
fi
if [ ! -d "$TARGET" ]; then
echo "ERR: Destination directory '${TARGET}' does not exist" 1>&2
exit 1