i mounted nfs volume in fstab file
script doesnt start any volume - just copies nesessary data
below is my script /etc/cron.daily/mailcow-backup
#!/bin/sh
Backup mailcow data
set -e
OUT=“$(mktemp)”
export MAILCOW_BACKUP_LOCATION=“/mnt/nfs-qnap/mailcow_backups”
SCRIPT=“/opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh”
PARAMETERS=“backup crypt redis rspamd postfix mysql”
OPTIONS=“–delete-days 7”
run command
set +e
“${SCRIPT}” ${PARAMETERS} ${OPTIONS} 2>&1 > “$OUT”
RESULT=$?
if [ $RESULT -ne 0 ]
then
echo “${SCRIPT} ${PARAMETERS} ${OPTIONS} encounters an error:”
echo “RESULT=$RESULT”
echo “STDOUT / STDERR:”
cat “$OUT”
fi