cmd/syncthing: Remove old temp index dbs on startup (fixes #3529)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3532
This commit is contained in:
parent
04dad8485a
commit
00a654845f
@ -1124,15 +1124,16 @@ func autoUpgrade(cfg *config.Wrapper) {
|
|||||||
// suitable time after they have gone out of fashion.
|
// suitable time after they have gone out of fashion.
|
||||||
func cleanConfigDirectory() {
|
func cleanConfigDirectory() {
|
||||||
patterns := map[string]time.Duration{
|
patterns := map[string]time.Duration{
|
||||||
"panic-*.log": 7 * 24 * time.Hour, // keep panic logs for a week
|
"panic-*.log": 7 * 24 * time.Hour, // keep panic logs for a week
|
||||||
"audit-*.log": 7 * 24 * time.Hour, // keep audit logs for a week
|
"audit-*.log": 7 * 24 * time.Hour, // keep audit logs for a week
|
||||||
"index": 14 * 24 * time.Hour, // keep old index format for two weeks
|
"index": 14 * 24 * time.Hour, // keep old index format for two weeks
|
||||||
"index-v0.11.0.db": 14 * 24 * time.Hour, // keep old index format for two weeks
|
"index-v0.11.0.db": 14 * 24 * time.Hour, // keep old index format for two weeks
|
||||||
"index-v0.13.0.db": 14 * 24 * time.Hour, // keep old index format for two weeks
|
"index-v0.13.0.db": 14 * 24 * time.Hour, // keep old index format for two weeks
|
||||||
"index*.converted": 14 * 24 * time.Hour, // keep old converted indexes for two weeks
|
"index*.converted": 14 * 24 * time.Hour, // keep old converted indexes for two weeks
|
||||||
"config.xml.v*": 30 * 24 * time.Hour, // old config versions for a month
|
"config.xml.v*": 30 * 24 * time.Hour, // old config versions for a month
|
||||||
"*.idx.gz": 30 * 24 * time.Hour, // these should for sure no longer exist
|
"*.idx.gz": 30 * 24 * time.Hour, // these should for sure no longer exist
|
||||||
"backup-of-v0.8": 30 * 24 * time.Hour, // these neither
|
"backup-of-v0.8": 30 * 24 * time.Hour, // these neither
|
||||||
|
"tmp-index-sorter.*": time.Minute, // these should never exist on startup
|
||||||
}
|
}
|
||||||
|
|
||||||
for pat, dur := range patterns {
|
for pat, dur := range patterns {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user