mirror of
https://github.com/ggogel/seafile-containerized.git
synced 2025-09-02 02:39:26 +00:00
Check if cron entry for garbage collection already exists
This commit is contained in:
parent
45a585d945
commit
ff1c91c6d1
1 changed files with 6 additions and 2 deletions
|
@ -34,7 +34,11 @@ function stop_socat {
|
||||||
function gc_cron {
|
function gc_cron {
|
||||||
if [[ ! -z $GC_CRON ]]; then
|
if [[ ! -z $GC_CRON ]]; then
|
||||||
echo "Scheduling garbage collection..."
|
echo "Scheduling garbage collection..."
|
||||||
|
|
||||||
|
if ! crontab -l | grep -Fxq "$GC_CRON /scripts/gc.sh >> /opt/seafile/logs/gc.log 2>&1"; then
|
||||||
(crontab -l ; echo "$GC_CRON /scripts/gc.sh >> /opt/seafile/logs/gc.log 2>&1") | crontab
|
(crontab -l ; echo "$GC_CRON /scripts/gc.sh >> /opt/seafile/logs/gc.log 2>&1") | crontab
|
||||||
|
fi
|
||||||
|
|
||||||
service cron start
|
service cron start
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue