Skip to content
Snippets Groups Projects
Commit 81c99395 authored by Radoslav Bodó's avatar Radoslav Bodó
Browse files

scripts: add cron helper

parent 4cf2afd5
No related branches found
No related tags found
No related merge requests found
Pipeline #7688 passed
#!/bin/sh
# usage:
# 12 1 * * * /bin/sh /opt/rwm/scripts/cron.sh
umask 077
LOGFILE="/var/log/rwm/cron.log.$(date +'%Y-%m-%dT%H:%M:%S%z')"
mkdir -p "$(dirname "$LOGFILE")"
/opt/rwm/rwm.py --config /etc/rwm.yml backup-all 1>"$LOGFILE" 2>&1
RET=$?
if [ $RET = 0 ]; then
RESULT="OK"
else
RESULT="ERROR"
fi
# shellcheck disable=SC2002
cat "$LOGFILE" | mail -E -s "rwm backup-all $RESULT" $USER
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment