From 55d18fffd14d11b2ae6330d7a75f66d8bd1c653c Mon Sep 17 00:00:00 2001 From: lubiana Date: Sun, 30 Jun 2024 10:18:24 +0200 Subject: [PATCH] #25 --- .forgejo/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 72b4710..5ceffa4 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -34,6 +34,10 @@ jobs: ssh-keyscan -H $HOST >> ~/.ssh/known_hosts # stop services ssh ${USERNAME}@${HOST} systemctl --user stop pod-futtern + # backup database + ssh ${USERNAME}@${HOST} cp ${TARGETDIR}/app/var/data.db ${TARGETDIR}/backup/data.db-$(date +"%Y%m%d%H%M%S") + # only keep last 10 backupts + ssh ${USERNAME}@${HOST} ls -1tr ${TARGETDIR}/backup/ | head -n -10 | xargs -d '\n' rm -f -- # SCP files to the remote host rsync -avz --delete deploy/ ${USERNAME}@${HOST}:${TARGETDIR} --exclude=var # run update script -- 2.39.5