diff --git a/client/build/entrypoint.sh b/client/build/entrypoint.sh index bd8d2c7..11f9894 100644 --- a/client/build/entrypoint.sh +++ b/client/build/entrypoint.sh @@ -3,9 +3,9 @@ set -e chmod 600 /syncer/.ssh/id_syncer -echo -e "\n[$(date +"%Y/%m/%d-%H:%M:%S")] Performing initial sync..." +echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Performing initial sync..." /syncer/sync.sh > /proc/self/fd/1 2>/proc/self/fd/2 -echo -e "\n[$(date +"%Y/%m/%d-%H:%M:%S")] Creating cron job..." +echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Creating cron job..." if [ "$SYNC_DELAY" == "true" ]; then echo "$SYNC_SCHEDULE /syncer/sync.sh delay > /proc/self/fd/1 2>/proc/self/fd/2" >> $CRONTAB_FILE else @@ -32,8 +32,8 @@ EOF fi fi -echo -e "\n[$(date +"%Y/%m/%d-%H:%M:%S")] Starting caddy..." +echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Starting caddy..." /usr/sbin/caddy start -config /etc/caddy/Caddyfile -echo -e "\n[$(date +"%Y/%m/%d-%H:%M:%S")] Starting cron..." +echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Starting cron..." exec "$@" \ No newline at end of file diff --git a/client/build/sync.sh b/client/build/sync.sh index c59603f..15bd920 100644 --- a/client/build/sync.sh +++ b/client/build/sync.sh @@ -4,19 +4,16 @@ set -e # insert optional random delay if [ x$1 == x"delay" ]; then - echo -e "\n[$(date +"%Y/%m/%d-%H:%M:%S")] Waiting for random delay..." + echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Waiting for random delay..." sleep $(( RANDOM % SYNC_DELAY_MAX_SECONDS + 1 )) - echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Sync starts NOW!" -else - echo -e "\n[$(date +"%Y/%m/%d-%H:%M:%S")] Immediate sync starts NOW!" fi +echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Sync sync starts NOW!" # sync -echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Rsyncing content..." /usr/bin/rsync -e "ssh -l syncer -p $SYNC_PORT -i /syncer/.ssh/id_syncer -o StrictHostKeyChecking=no" -av --exclude '*.json' $SYNC_PEER:/ /syncer/library # generate content library manifest echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Generating content library manifest..." /usr/bin/python3 /syncer/update_library_manifests.py -n 'Library' -p /syncer/library/ -echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Sync tasks complete!\n" \ No newline at end of file +echo -e "[$(date +"%Y/%m/%d-%H:%M:%S")] Sync tasks complete!" \ No newline at end of file