diff --git a/Dockerfile b/Dockerfile index 7f2d39a..a02fbca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,5 +16,7 @@ RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositorie rm -rf /var/cache/apk/* COPY start.sh /usr/local/bin/start.sh +COPY db-backup.py /usr/local/bin/db-backup.py +COPY db-restore.py /usr/local/bin/db-restore.py CMD [ "/usr/local/bin/start.sh", "$LIVE_DB", "$BACXKUP_DB" ] diff --git a/start.sh b/start.sh index 47b22b2..b0e9032 100755 --- a/start.sh +++ b/start.sh @@ -8,12 +8,12 @@ echo -e 'Starting the sidecar container to periodically backup the sonarr databa chown 1003:1003 /app-remote-config/* echo -e 'Copy the config from the remote share to the locali drive' touch /mnt/app-local-config/$LIVE_DB -python3 /app-remote-config/db-restore.py $BACKUP_DB $LIVE_DB +python3 /usr/local/bin/db-restore.py $BACKUP_DB $LIVE_DB find /app-remote-config/ -type -f -not -iname $BACKUP_DB -exec cp -fvp '{}' '/mnt/app-local-config/{}' ';' chown -R 1003:1003 /mnt/app-local-config echo -e 'Perform periodic backup of database' while true; do sleep 890 date - python3 /app-remote-config/db-backup.py $LIVE_DB $BACKUP_DB + python3 /usr/local/bin/db-backup.py $LIVE_DB $BACKUP_DB done