diff --git a/seafile-server/scripts/start.sh b/seafile-server/scripts/start.sh index 7657ea0..7805453 100644 --- a/seafile-server/scripts/start.sh +++ b/seafile-server/scripts/start.sh @@ -2,7 +2,7 @@ source /scripts/utils.sh -trap 'sigterm' SIGTERM +gc_cron & start_server & start_socat & keep_running \ No newline at end of file diff --git a/seafile-server/scripts/utils.sh b/seafile-server/scripts/utils.sh index 8e121a0..9846ae0 100644 --- a/seafile-server/scripts/utils.sh +++ b/seafile-server/scripts/utils.sh @@ -31,6 +31,13 @@ function stop_socat { pkill -9 socat } +function gc_cron { + if [[ ! -z $GC_CRON ]]; then + echo "Scheduling garbage collection..." + (crontab -l ; echo "$GC_CRON /scripts/gc.sh >> /opt/seafile/logs/gc.log 2>&1") | crontab + service cron start + fi +} function keep_running { while true; do tail -f /dev/null & wait ${!}