2018-10-27 08:42:54 +00:00
|
|
|
#!/bin/bash
|
2021-02-01 13:17:29 +00:00
|
|
|
source /scripts/utils.sh
|
2018-10-27 08:42:54 +00:00
|
|
|
SEAFILE_DIR=/opt/seafile/seafile-server-latest
|
|
|
|
|
|
|
|
if [[ $SEAFILE_SERVER != *"pro"* ]]; then
|
2024-02-14 10:05:59 +00:00
|
|
|
touch /tmp/gc_active
|
2021-02-01 11:57:36 +00:00
|
|
|
echo "Seafile CE: Stop Seafile to perform offline garbage collection."
|
2021-02-01 13:17:29 +00:00
|
|
|
stop_socat
|
2021-02-01 11:57:36 +00:00
|
|
|
$SEAFILE_DIR/seafile.sh stop
|
|
|
|
echo "Waiting for the server to shut down properly..."
|
2023-02-26 11:23:53 +00:00
|
|
|
sleep 30
|
|
|
|
echo "Kill remaining processes with SIGKILL signal."
|
|
|
|
sig_kill_all
|
2018-10-27 08:42:54 +00:00
|
|
|
else
|
2021-02-01 11:57:36 +00:00
|
|
|
echo "Seafile Pro: Perform online garbage collection."
|
2018-10-27 08:42:54 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-01 15:34:57 +00:00
|
|
|
$SEAFILE_DIR/seaf-gc.sh "$@"
|
2018-10-27 08:42:54 +00:00
|
|
|
|
|
|
|
if [[ $SEAFILE_SERVER != *"pro"* ]]; then
|
2024-02-14 10:05:59 +00:00
|
|
|
echo "Seafile CE: Offline garbage collection completed. Exiting..."
|
|
|
|
echo "Set the restart policy of this container to unless-stopped to restart it automatically after garbage collection."
|
|
|
|
rm -f /tmp/gc_active
|
2018-10-27 08:42:54 +00:00
|
|
|
fi
|