seafile-containerized/seafile-server/scripts/gc.sh

25 lines
680 B
Bash
Raw Normal View History

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
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
2021-02-01 13:17:29 +00:00
echo "Seafile CE: Offline garbage collection completed. Starting Seafile."
2021-02-01 11:57:36 +00:00
sleep 3
$SEAFILE_DIR/seafile.sh start
2021-02-01 13:17:29 +00:00
start_socat
2018-10-27 08:42:54 +00:00
fi