mirror of
https://github.com/ggogel/seafile-containerized.git
synced 2024-11-16 17:05:32 +00:00
add cron job creation
This commit is contained in:
parent
50b8433b2f
commit
f9eca5c59a
|
@ -2,7 +2,7 @@
|
|||
|
||||
source /scripts/utils.sh
|
||||
|
||||
trap 'sigterm' SIGTERM
|
||||
gc_cron &
|
||||
start_server &
|
||||
start_socat &
|
||||
keep_running
|
|
@ -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 ${!}
|
||||
|
|
Loading…
Reference in a new issue