From 679792442f01e7ce0d9461717a31cf9aa6e7bed6 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Thu, 19 Mar 2020 17:04:53 +0800 Subject: [PATCH] modified: start.sh Switched to local (emptyDir) rather than ramdisk --- start.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/start.sh b/start.sh index 596dc55..02fb99a 100644 --- a/start.sh +++ b/start.sh @@ -3,22 +3,16 @@ ## Script to automate the copy of Sonarr databases ## echo -e 'Starting the sidecar container to periodically backup the sonarr databases' -echo -e 'Create the ramdisk file' -dd if=/dev/zero of=/ramdisk/image.ext4 count=0 bs=1 seek=400M -echo -e 'Create filesystem on ramdisk file' -mkfs.ext4 /ramdisk/image.ext4 -echo -e 'Mount the ramdisk file to /mnt/sonarr-ramdisk-mount' -mount /ramdisk/image.ext4 /mnt/sonarr-ramdisk-mount -chown 1003:1003 /mnt/sonarr-ramdisk-mount +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-ramdisk-mount +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-ramdisk-mount/*.* - fsfreeze --freeze /mnt/sonarr-ramdisk-mount + sync /mnt/sonarr-local/config/*.* + fsfreeze --freeze /mnt/sonarr-local-config sleep 10 - cp -fvp /mnt/sonarr-ramdisk-mount/*.* /sonarr-config/ - fsfreeze --unfreeze /mnt/sonarr-ramdisk-mount + cp -fvp /mnt/sonarr-local-config/*.* /sonarr-config/ + fsfreeze --unfreeze /mnt/sonarr-local-config done