x86_64-alpine-sonarr-sidecar/start.sh
2020-07-21 23:11:08 +08:00

19 lines
602 B
Bash
Executable File

#!/bin/sh
##
## Script to automate the copy of Sonarr databases
##
echo -e 'Starting the sidecar container to periodically backup the sonarr databases'
chown 1003:1003 /mnt/sonarr-local-config
echo -e 'Copy the config from the remote share to the ramdisk'
cp -fvp /sonarr-config/*.* /mnt/sonarr-local-config
echo -e 'Set up the filesystem freeze, copy, unfreeze loop'
while true; do
sleep 890
date
sync /mnt/sonarr-local-config/*.*
fsfreeze --freeze /mnt/sonarr-local-config
sleep 10
cp -fvp /mnt/sonarr-local-config/*.* /sonarr-config/
fsfreeze --unfreeze /mnt/sonarr-local-config
done