diff options
Diffstat (limited to 'scripts/prune-storage.ts')
-rwxr-xr-x | scripts/prune-storage.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index 4ab0b4863..c9e4dbd4b 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts | |||
@@ -19,7 +19,8 @@ async function run () { | |||
19 | 19 | ||
20 | const storageOnlyOwnedToPrune = [ | 20 | const storageOnlyOwnedToPrune = [ |
21 | CONFIG.STORAGE.VIDEOS_DIR, | 21 | CONFIG.STORAGE.VIDEOS_DIR, |
22 | CONFIG.STORAGE.TORRENTS_DIR | 22 | CONFIG.STORAGE.TORRENTS_DIR, |
23 | CONFIG.STORAGE.REDUNDANCY_DIR | ||
23 | ] | 24 | ] |
24 | 25 | ||
25 | const storageForAllToPrune = [ | 26 | const storageForAllToPrune = [ |
@@ -36,6 +37,9 @@ async function run () { | |||
36 | toDelete = toDelete.concat(await pruneDirectory(directory, false)) | 37 | toDelete = toDelete.concat(await pruneDirectory(directory, false)) |
37 | } | 38 | } |
38 | 39 | ||
40 | const tmpFiles = await readdir(CONFIG.STORAGE.TMP_DIR) | ||
41 | toDelete = toDelete.concat(tmpFiles.map(t => join(CONFIG.STORAGE.TMP_DIR, t))) | ||
42 | |||
39 | if (toDelete.length === 0) { | 43 | if (toDelete.length === 0) { |
40 | console.log('No files to delete.') | 44 | console.log('No files to delete.') |
41 | return | 45 | return |
@@ -91,6 +95,7 @@ async function askConfirmation () { | |||
91 | confirm: { | 95 | confirm: { |
92 | type: 'string', | 96 | type: 'string', |
93 | description: 'These following unused files can be deleted, but please check your backups first (bugs happen).' + | 97 | description: 'These following unused files can be deleted, but please check your backups first (bugs happen).' + |
98 | ' Notice PeerTube must have been stopped when your ran this script.' + | ||
94 | ' Can we delete these files?', | 99 | ' Can we delete these files?', |
95 | default: 'n', | 100 | default: 'n', |
96 | required: true | 101 | required: true |