aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/client.sh2
-rwxr-xr-xscripts/clean/server/test.sh1
-rwxr-xr-xscripts/prune-storage.ts7
-rwxr-xr-xscripts/upgrade.sh10
4 files changed, 18 insertions, 2 deletions
diff --git a/scripts/build/client.sh b/scripts/build/client.sh
index 62daf98cf..be3eef802 100755
--- a/scripts/build/client.sh
+++ b/scripts/build/client.sh
@@ -41,7 +41,7 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
41 languages=("fr_FR") 41 languages=("fr_FR")
42 else 42 else
43 # Supported languages 43 # Supported languages
44 languages=("fr_FR" "pt_BR" "sv_SE" "eu_ES" "ca_ES" "cs_CZ" "eo" "zh_Hant_TW" "de_DE" "es_ES" "oc" "zh_Hans_CN") 44 languages=("pl_PL" "it_IT" "ru_RU" "fr_FR" "pt_BR" "sv_SE" "eu_ES" "ca_ES" "cs_CZ" "eo" "zh_Hant_TW" "de_DE" "es_ES" "oc" "zh_Hans_CN")
45 fi 45 fi
46 46
47 for lang in "${languages[@]}"; do 47 for lang in "${languages[@]}"; do
diff --git a/scripts/clean/server/test.sh b/scripts/clean/server/test.sh
index 235ff52cc..b897c30ba 100755
--- a/scripts/clean/server/test.sh
+++ b/scripts/clean/server/test.sh
@@ -18,6 +18,7 @@ removeFiles () {
18 18
19dropRedis () { 19dropRedis () {
20 redis-cli KEYS "bull-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL 20 redis-cli KEYS "bull-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL
21 redis-cli KEYS "redis-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL
21} 22}
22 23
23for i in $(seq 1 6); do 24for i in $(seq 1 6); do
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
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh
index c70b3b42a..4f7c58edd 100755
--- a/scripts/upgrade.sh
+++ b/scripts/upgrade.sh
@@ -20,6 +20,16 @@ if [ ! -e "$PEERTUBE_PATH/versions" -o ! -e "$PEERTUBE_PATH/config/production.ya
20 exit 1 20 exit 1
21fi 21fi
22 22
23if [ -x "$(command -v awk)" ] && [ -x "$(command -v sed)" ] ; then
24 REMAINING=$(df -k $PEERTUBE_PATH | awk '{ print $4}' | sed -n 2p)
25 ONE_GB=$((1024 * 1024))
26 if [ "$REMAINING" -lt "$ONE_GB" ]; then
27 echo "Error - not enough free space for upgrading"
28 echo ""
29 echo "Make sure you have at least 1 GB of free space in $PEERTUBE_PATH"
30 exit 1
31 fi
32fi
23 33
24# Backup database 34# Backup database
25SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" 35SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak"