Skip to content

Commit

Permalink
Merge pull request #187 from haiwen/update_clean_database.md
Browse files Browse the repository at this point in the history
update clear_invalid_repo_data manual
  • Loading branch information
freeplant authored Aug 23, 2023
2 parents 18e59f1 + d3360d5 commit 1bd5a0c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions manual/maintain/clean_database.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@

Since version 5.0, we offered command to clear expired session records in Seahub database.

For version 7.0 and earlier
```
cd <install-path>/seafile-server-latest
./seahub.sh python-env seahub/manage.py clearsessions
```

For version 7.1 and later
```
cd <install-path>/seafile-server-latest
./seahub.sh python-env python3 seahub/manage.py clearsessions
Expand Down Expand Up @@ -100,18 +93,23 @@ cd <install-path>/seafile-server-latest
Since version 6.2, we offer command to clear outdated library records in Seahub database,
e.g. records that are not deleted after a library is deleted. This is because users can restore a deleted library, so we can't delete these records at library deleting time.

For version 7.0 and earlier
```
cd <install-path>/seafile-server-latest
./seahub.sh python-env seahub/manage.py clear_invalid_repo_data
./seahub.sh python-env python3 seahub/manage.py clear_invalid_repo_data
```

For version 7.1 and later
This command has been improved in version 10.0, including:

1. It will clear the invalid data in small batch, avoiding consume too much database resource in a short time.

2. Dry-run mode: if you just want to see how much invalid data can be deleted without actually deleting any data, you can use the dry-run option, e.g.

```
cd <install-path>/seafile-server-latest
./seahub.sh python-env python3 seahub/manage.py clear_invalid_repo_data
./seahub.sh python-env python3 seahub/manage.py clear_invalid_repo_data --dry-run=true
```


### Library Sync Tokens

There are two tables in Seafile db that are related to library sync tokens.
Expand Down

0 comments on commit 1bd5a0c

Please sign in to comment.