Clean up document related to GC

This commit is contained in:
Daniel Pan 2024-10-25 11:24:52 +08:00
parent 7045d14ca3
commit 368efe0568
5 changed files with 10 additions and 86 deletions

View File

@ -10,10 +10,6 @@ The GC program cleans up two types of unused blocks:
1. Blocks that no library references to, that is, the blocks belong to deleted libraries;
2. If you set history length limit on some libraries, the out-dated blocks in those libraries will also be removed.
**Before running GC, you must shutdown the Seafile program on your server if you use the community edition. For professional edition, online GC operation is supported. If you use Professional edition, you don't need to shutdown the Seafile program if you are using MySQL.**
This is because new blocks written into Seafile while GC is running may be mistakenly deleted by the GC program.
At the bottom of the page there is a script that you can use to run the cleanup manually or e.g. once a week with as cronjob.
## Run GC
@ -130,86 +126,6 @@ seaf-gc.sh --id-prefix a123
```
## GC cleanup script for Community Version
To use this script you need:
* Setup the seafile-service file at '/etc/init.d/seafile-server'
* Files of seafile setup need to be owner by 'seafile:nogroup' or 'seafile:seafile'
* Run the script with sudo or as root
* Put the script into crontab of a root user
Create the script file (change the location to your liking):
```
touch /opt/haiwen/seafile/cleanupScript.sh
```
Use your favorite text editor and paste the following code:
```
#!/bin/bash
#####
# Uncomment the following line if you rather want to run the script manually.
# Display usage if the script is not run as root user
# if [[ $USER != "root" ]]; then
# echo "This script must be run as root user!"
# exit 1
# fi
#
# echo "Super User detected!!"
# read -p "Press [ENTER] to start the procedure, this will stop the seafile server!!"
#####
# stop the server
echo Stopping the Seafile-Server...
systemctl stop seafile.service
systemctl stop seahub.service
echo Giving the server some time to shut down properly....
sleep 20
# run the cleanup
echo Seafile cleanup started...
sudo -u seafile $pathtoseafile/seafile-server-latest/seaf-gc.sh
echo Giving the server some time....
sleep 10
# start the server again
echo Starting the Seafile-Server...
systemctl start seafile.service
systemctl start seahub.service
echo Seafile cleanup done!
```
Make sure that the script has been given execution rights, to do that run this command.
```
sudo chmod +x /path/to/yourscript.sh
```
Then open crontab with the root user
```
crontab -e
```
Add the following line (change the location of your script accordingly!)
```
0 2 * * Sun /opt/haiwen/seafile/cleanupScript.sh
```
The script will then run every Sunday at 2:00 AM.
## GC in Seafile docker container

View File

@ -165,6 +165,13 @@ Other changes
Please check our document for how to upgrade to [10.0](../upgrade/upgrade_notes_for_10.0.x.md).
### 10.0.17 (2024-10-23)
This release is for Docker image only
* [fix] Update the version of sqlalchemy to make "activities" page work. The bug was introduced in v10.0.16.
### 10.0.16 (2024-06-21)
* [fix] Fix CollaboraOnline integration for read-only shares and share links

View File

@ -126,7 +126,7 @@ Follow the instructions in [Backup and restore for Seafile Docker](../administra
When files are deleted, the blocks comprising those files are not immediately removed as there may be other files that reference those blocks (due to the magic of deduplication). To remove them, Seafile requires a ['garbage collection'](../administration/seafile_gc.md) process to be run, which detects which blocks no longer used and purges them. (**NOTE:** for technical reasons, the GC process does not guarantee that _every single_ orphan block will be deleted.)
The required scripts can be found in the `/scripts` folder of the docker container. To perform garbage collection, simply run `docker exec seafile /scripts/gc.sh`. For the community edition, this process will stop the seafile server, but it is a relatively quick process and the seafile server will start automatically once the process has finished. The Professional supports an online garbage collection.
The required scripts can be found in the `/scripts` folder of the docker container. To perform garbage collection, simply run `docker exec seafile /scripts/gc.sh`.
## FAQ

View File

@ -174,7 +174,7 @@ Follow the instructions in [Backup and restore for Seafile Docker](../administra
When files are deleted, the blocks comprising those files are not immediately removed as there may be other files that reference those blocks (due to the magic of deduplication). To remove them, Seafile requires a ['garbage collection'](../administration/seafile_gc.md) process to be run, which detects which blocks no longer used and purges them. (NOTE: for technical reasons, the GC process does not guarantee that _every single_ orphan block will be deleted.)
The required scripts can be found in the `/scripts` folder of the docker container. To perform garbage collection, simply run `docker exec seafile /scripts/gc.sh`. For the community edition, this process will stop the seafile server, but it is a relatively quick process and the seafile server will start automatically once the process has finished. The Professional supports an online garbage collection.
The required scripts can be found in the `/scripts` folder of the docker container. To perform garbage collection, simply run `docker exec seafile /scripts/gc.sh`.
## FAQ

View File

@ -17,6 +17,7 @@ Seafile version 12.0 has following major changes:
* SeaDoc is now stable, providing online notes and documents feature
* A new wiki module (still in beta, disabled by default)
* A new trash mechanism, that deleted files will be recorded in database for fast listing. In the old version, deleted files are scanned from library history, which is slow.
* Community edition now also support online GC (because SQLite support is dropped)
Other changes: