diff options
author | Chocobozzz <me@florianbigard.com> | 2019-02-06 12:26:58 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-02-06 12:26:58 +0100 |
commit | 73471b1a52f242e86364ffb077ea6cadb3b07ae2 (patch) | |
tree | 43dbb7748e281f8d80f15326f489cdea10ec857d /scripts/prune-storage.ts | |
parent | c22419dd265c0c7185bf4197a1cb286eb3d8ebc0 (diff) | |
parent | f5305c04aae14467d6f957b713c5a902275cbb89 (diff) | |
download | PeerTube-73471b1a52f242e86364ffb077ea6cadb3b07ae2.tar.gz PeerTube-73471b1a52f242e86364ffb077ea6cadb3b07ae2.tar.zst PeerTube-73471b1a52f242e86364ffb077ea6cadb3b07ae2.zip |
Merge branch 'release/v1.2.0'
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 |