Keep data directories through CLEAN_INSTALL instead of copying them

create_backup copied uploads, storage and similar directories twice per update and needed their size again in free space. CLEAN_INSTALL_KEEP moves them aside instead. Only directories the upstream release does not ship, in scripts that restored right after the fetch. Requires community-scripts/core#61.
This commit is contained in:
MickLesk
2026-10-02 20:05:17 +02:00
parent 76f17ddf67
commit 057095406c
26 changed files with 47 additions and 85 deletions
+2 -2
View File
@@ -36,9 +36,9 @@ function update_script() {
systemctl stop airtrail
msg_ok "Stopped Service"
create_backup /opt/airtrail/.env /opt/airtrail/uploads
create_backup /opt/airtrail/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "airtrail" "johanohly/AirTrail" "tarball" "latest" "/opt/airtrail"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="uploads" fetch_and_deploy_gh_release "airtrail" "johanohly/AirTrail" "tarball" "latest" "/opt/airtrail"
restore_backup
+2 -4
View File
@@ -38,11 +38,9 @@ function update_script() {
systemctl stop nginx "$PHP_FPM_SERVICE"
msg_ok "Stopped Services"
create_backup /opt/chevereto/app/env.php \
/opt/chevereto/images \
/opt/chevereto/content
create_backup /opt/chevereto/app/env.php /opt/chevereto/content
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "chevereto" "chevereto/chevereto" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="images" fetch_and_deploy_gh_release "chevereto" "chevereto/chevereto" "tarball"
restore_backup
+2 -9
View File
@@ -35,16 +35,9 @@ function update_script() {
systemctl stop cryptpad
msg_ok "Stopped Service"
create_backup /opt/cryptpad/config/config.js \
/opt/cryptpad/blob \
/opt/cryptpad/block \
/opt/cryptpad/customize \
/opt/cryptpad/data \
/opt/cryptpad/datastore \
/opt/cryptpad/www/common/onlyoffice/dist \
/opt/cryptpad/onlyoffice-conf
create_backup /opt/cryptpad/config/config.js /opt/cryptpad/www/common/onlyoffice/dist
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "cryptpad" "cryptpad/cryptpad" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="blob block customize data datastore onlyoffice-conf" fetch_and_deploy_gh_release "cryptpad" "cryptpad/cryptpad" "tarball"
restore_backup
+2 -2
View File
@@ -38,9 +38,9 @@ function update_script() {
systemctl stop docmost
msg_ok "Stopped Service"
create_backup /opt/docmost/.env /opt/docmost/data
create_backup /opt/docmost/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "docmost" "docmost/docmost" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="data" fetch_and_deploy_gh_release "docmost" "docmost/docmost" "tarball"
restore_backup
+2 -3
View File
@@ -36,9 +36,8 @@ function update_script() {
systemctl stop flame
msg_ok "Stopped Service"
create_backup /opt/flame/.env \
/opt/flame/data
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "flame" "pawelmalak/flame" "tarball"
create_backup /opt/flame/.env
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="data" fetch_and_deploy_gh_release "flame" "pawelmalak/flame" "tarball"
restore_backup
msg_info "Rebuilding Application"
+2 -2
View File
@@ -38,9 +38,9 @@ function update_script() {
systemctl stop grist
msg_ok "Stopped Service"
create_backup /opt/grist/.env /opt/grist/docs /opt/grist/grist-sessions.db /opt/grist/landing.db
create_backup /opt/grist/.env /opt/grist/grist-sessions.db /opt/grist/landing.db
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "grist" "gristlabs/grist-core" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="docs" fetch_and_deploy_gh_release "grist" "gristlabs/grist-core" "tarball"
restore_backup
+2 -2
View File
@@ -36,9 +36,9 @@ function update_script() {
systemctl stop homelable
msg_ok "Stopped Service"
create_backup /opt/homelable/backend/.env /opt/homelable/data /opt/homelable/mcp/.env
create_backup /opt/homelable/backend/.env /opt/homelable/mcp/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "homelable" "Pouzor/homelable" "tarball" "latest" "/opt/homelable"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="data" fetch_and_deploy_gh_release "homelable" "Pouzor/homelable" "tarball" "latest" "/opt/homelable"
restore_backup
+2 -2
View File
@@ -38,10 +38,10 @@ function update_script() {
systemctl stop homepage
msg_ok "Stopped service"
create_backup /opt/homepage/.env /opt/homepage/config
create_backup /opt/homepage/.env
BACKUP_DIR=/opt/homepage-assets.backup create_backup /opt/homepage/public/images /opt/homepage/public/icons
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "homepage" "gethomepage/homepage" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="config" fetch_and_deploy_gh_release "homepage" "gethomepage/homepage" "tarball"
restore_backup
+2 -7
View File
@@ -55,18 +55,13 @@ function update_script() {
printf '["%s"]\n' "$(<~/.hortusfox)" >app/migrations/verhist.json
fi
create_backup \
/opt/hortusfox/.env \
create_backup /opt/hortusfox/.env \
/opt/hortusfox/app/migrations/migrations.list \
/opt/hortusfox/app/migrations/verhist.json \
/opt/hortusfox/public/img \
/opt/hortusfox/public/attachments \
/opt/hortusfox/public/backup \
/opt/hortusfox/public/exports \
/opt/hortusfox/public/snd \
/opt/hortusfox/public/themes
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "hortusfox" "danielbrendel/hortusfox-web" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="public/attachments public/backup public/exports public/snd" fetch_and_deploy_gh_release "hortusfox" "danielbrendel/hortusfox-web" "tarball"
restore_backup
msg_info "Updating HortusFox"
+2 -2
View File
@@ -42,9 +42,9 @@ function update_script() {
NODE_VERSION="22" setup_nodejs
PG_VERSION="17" setup_postgresql
create_backup /opt/investbrain/.env /opt/investbrain/storage
create_backup /opt/investbrain/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Investbrain" "investbrainapp/investbrain" "tarball" "latest" "/opt/investbrain"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="storage" fetch_and_deploy_gh_release "Investbrain" "investbrainapp/investbrain" "tarball" "latest" "/opt/investbrain"
restore_backup
+2 -2
View File
@@ -36,9 +36,9 @@ function update_script() {
systemctl stop caddy
msg_ok "Stopped Services"
create_backup /opt/invoiceshelf/.env /opt/invoiceshelf/storage
create_backup /opt/invoiceshelf/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "invoiceshelf" "InvoiceShelf/InvoiceShelf" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="storage" fetch_and_deploy_gh_release "invoiceshelf" "InvoiceShelf/InvoiceShelf" "tarball"
restore_backup
+2 -2
View File
@@ -37,8 +37,8 @@ function update_script() {
systemctl stop php8.4-fpm librenms-scheduler.timer
msg_ok "Stopped Services"
create_backup /opt/librenms/.env /opt/librenms/config.php /opt/librenms/rrd
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "librenms" "librenms/librenms" "tarball"
create_backup /opt/librenms/.env /opt/librenms/config.php
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="rrd" fetch_and_deploy_gh_release "librenms" "librenms/librenms" "tarball"
restore_backup
msg_info "Updating LibreNMS"
+2 -2
View File
@@ -36,9 +36,9 @@ function update_script() {
RUST_CRATES="monolith" setup_rust
create_backup /opt/linkwarden/.env /opt/linkwarden/data
create_backup /opt/linkwarden/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "linkwarden" "linkwarden/linkwarden" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="data" fetch_and_deploy_gh_release "linkwarden" "linkwarden/linkwarden" "tarball"
restore_backup
+2 -2
View File
@@ -36,9 +36,9 @@ function update_script() {
systemctl stop nametag
msg_ok "Stopped Service"
create_backup /opt/nametag/.env /opt/nametag/data
create_backup /opt/nametag/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "nametag" "mattogodoy/nametag" "tarball" "latest" "/opt/nametag"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="data" fetch_and_deploy_gh_release "nametag" "mattogodoy/nametag" "tarball" "latest" "/opt/nametag"
restore_backup
+1 -5
View File
@@ -36,11 +36,7 @@ function update_script() {
systemctl stop ownfoil
msg_ok "Stopped Service"
create_backup /opt/ownfoil/app/config
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "${RELEASE}"
restore_backup
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="app/config" fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "${RELEASE}"
msg_info "Installing Dependencies"
cd /opt/ownfoil
+2 -2
View File
@@ -36,9 +36,9 @@ function update_script() {
systemctl stop passwordpusher
msg_ok "Stopped Service"
create_backup /opt/passwordpusher/storage /opt/passwordpusher/.env.production
create_backup /opt/passwordpusher/.env.production
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "passwordpusher" "pglombardo/PasswordPusher" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="storage" fetch_and_deploy_gh_release "passwordpusher" "pglombardo/PasswordPusher" "tarball"
restore_backup
+2 -3
View File
@@ -37,10 +37,9 @@ function update_script() {
systemctl stop postiz-orchestrator postiz-frontend postiz-backend
msg_ok "Stopped Services"
create_backup /opt/postiz/.env \
/opt/postiz/uploads
create_backup /opt/postiz/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "postiz" "gitroomhq/postiz-app" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="uploads" fetch_and_deploy_gh_release "postiz" "gitroomhq/postiz-app" "tarball"
restore_backup
+1 -5
View File
@@ -35,12 +35,8 @@ function update_script() {
systemctl stop radicale
msg_ok "Stopped service"
create_backup /opt/radicale/users
PYTHON_VERSION="3.13" setup_uv
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Radicale" "Kozea/Radicale" "tarball" "latest" "/opt/radicale"
restore_backup
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="users" fetch_and_deploy_gh_release "Radicale" "Kozea/Radicale" "tarball" "latest" "/opt/radicale"
if grep -q 'start.sh' /etc/systemd/system/radicale.service; then
sed -i -e '/^Description/i[Unit]' \
+2 -2
View File
@@ -36,9 +36,9 @@ function update_script() {
systemctl stop caddy
msg_ok "Stopped Services"
create_backup /opt/solidtime/.env /opt/solidtime/storage
create_backup /opt/solidtime/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "solidtime" "solidtime-io/solidtime" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="storage" fetch_and_deploy_gh_release "solidtime" "solidtime-io/solidtime" "tarball"
restore_backup
+2 -2
View File
@@ -38,9 +38,9 @@ function update_script() {
systemctl stop soulsync
msg_ok "Stopped Service"
create_backup /opt/soulsync/config /opt/soulsync/data
create_backup /opt/soulsync/config
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "soulsync" "Nezreka/SoulSync" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="data" fetch_and_deploy_gh_release "soulsync" "Nezreka/SoulSync" "tarball"
restore_backup
+1 -5
View File
@@ -37,11 +37,7 @@ function update_script() {
systemctl stop sparkyfitness-server nginx
msg_ok "Stopped Services"
create_backup /opt/sparkyfitness/SparkyFitnessServer/uploads /opt/sparkyfitness/SparkyFitnessServer/backup
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "sparkyfitness" "CodeWithCJ/SparkyFitness" "tarball"
restore_backup
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="SparkyFitnessServer/uploads SparkyFitnessServer/backup" fetch_and_deploy_gh_release "sparkyfitness" "CodeWithCJ/SparkyFitness" "tarball"
PNPM_VERSION="$(jq -r '.packageManager | split("@")[1]' /opt/sparkyfitness/package.json)"
NODE_VERSION="25" NODE_MODULE="pnpm@${PNPM_VERSION}" setup_nodejs
+1 -3
View File
@@ -65,9 +65,7 @@ EOF
msg_ok "Stopped services"
fi
create_backup /opt/sure/storage
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Sure" "we-promise/sure" "tarball" "latest" "/opt/sure"
restore_backup
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="storage" fetch_and_deploy_gh_release "Sure" "we-promise/sure" "tarball" "latest" "/opt/sure"
RUBY_VERSION="$(cat /opt/sure/.ruby-version)" RUBY_INSTALL_RAILS=false HOME=/root setup_ruby
msg_info "Updating Sure"
+2 -2
View File
@@ -44,11 +44,11 @@ function update_script() {
systemctl stop tandoor
msg_ok "Stopped Service"
create_backup /opt/tandoor/config /opt/tandoor/api /opt/tandoor/mediafiles /opt/tandoor/staticfiles /opt/tandoor/.env
create_backup /opt/tandoor/.env
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
PYTHON_VERSION="3.13" setup_uv
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "tandoor" "TandoorRecipes/recipes" "tarball" "latest" "/opt/tandoor"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="config api mediafiles staticfiles" fetch_and_deploy_gh_release "tandoor" "TandoorRecipes/recipes" "tarball" "latest" "/opt/tandoor"
restore_backup
+2 -6
View File
@@ -163,13 +163,9 @@ EOF
fi
msg_ok "Migrated Configuration"
create_backup \
/opt/termix/db/data \
/opt/termix/data \
/opt/termix/uploads \
/opt/termix/.env
create_backup /opt/termix/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "termix" "Termix-SSH/Termix" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="db/data data uploads" fetch_and_deploy_gh_release "termix" "Termix-SSH/Termix" "tarball"
restore_backup
+2 -2
View File
@@ -41,9 +41,9 @@ function update_script() {
systemctl stop transmute
msg_ok "Stopped Service"
create_backup /opt/transmute/backend/.env /opt/transmute/data
create_backup /opt/transmute/backend/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "transmute" "transmute-app/transmute" "tarball"
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="data" fetch_and_deploy_gh_release "transmute" "transmute-app/transmute" "tarball"
restore_backup
+1 -5
View File
@@ -36,11 +36,7 @@ function update_script() {
systemctl stop xyops
msg_ok "Stopped Service"
create_backup /opt/xyops/data /opt/xyops/conf
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "xyops" "pixlcore/xyops" "tarball"
restore_backup
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="data conf" fetch_and_deploy_gh_release "xyops" "pixlcore/xyops" "tarball"
msg_info "Rebuilding Application"
cd /opt/xyops