Kaynağa Gözat

order stuff

poesty 1 yıl önce
ebeveyn
işleme
1ccf176c5b
2 değiştirilmiş dosya ile 10 ekleme ve 6 silme
  1. 5 3
      backup/backup_akkoma.sh
  2. 5 3
      update/update_akkoma.sh

+ 5 - 3
backup/backup_akkoma.sh

@@ -14,13 +14,15 @@ BACKUP_PATH=/home/plbk
 rm $BACKUP_PATH/*
 rm $AKKOMA_DBCONFIG_PATH
 
+# export config in database
+cd $AKKOMA_PATH
+su $AKKOMA_USER -s $SHELL -lc "./bin/pleroma_ctl config dump" > $AKKOMA_DBCONFIG_PATH
+sed -i 's/\r//g' $AKKOMA_DBCONFIG_PATH
+
 # stop akkoma
 systemctl stop $AKKOMA_SERVICE
 
 # backup database/config.exs/static files
-cd $AKKOMA_PATH
-su $AKKOMA_USER -s $SHELL -lc "./bin/pleroma_ctl config dump" > $AKKOMA_DBCONFIG_PATH
-sed -i 's/\r//g' $AKKOMA_DBCONFIG_PATH
 sudo -Hu postgres pg_dump -d $AKKOMA_DB  --format=custom -f $BACKUP_PATH/akkoma.pgdump
 tar -czpPf - $AKKOMA_STATIC_PATH $AKKOMA_CONFIG_PATH $BACKUP_PATH/akkoma.pgdump $AKKOMA_DBCONFIG_PATH | gpg -e -r 0 > $BACKUP_PATH/akbk+$(date +%Y%m%d-%H%M%S).tar.gz.gpg
 

+ 5 - 3
update/update_akkoma.sh

@@ -14,13 +14,15 @@ BACKUP_PATH=/home/plbk
 rm $BACKUP_PATH/*
 rm $AKKOMA_DBCONFIG_PATH
 
+# export config in database
+cd $AKKOMA_PATH
+su $AKKOMA_USER -s $SHELL -lc "./bin/pleroma_ctl config dump" > $AKKOMA_DBCONFIG_PATH
+sed -i 's/\r//g' $AKKOMA_DBCONFIG_PATH
+
 # stop akkoma
 systemctl stop $AKKOMA_SERVICE
 
 # backup database/config.exs/static files
-cd $AKKOMA_PATH
-su $AKKOMA_USER -s $SHELL -lc "./bin/pleroma_ctl config dump" > $AKKOMA_DBCONFIG_PATH
-sed -i 's/\r//g' $AKKOMA_DBCONFIG_PATH
 sudo -Hu postgres pg_dump -d $AKKOMA_DB  --format=custom -f $BACKUP_PATH/akkoma.pgdump
 tar -czpPf - $AKKOMA_STATIC_PATH $AKKOMA_CONFIG_PATH $BACKUP_PATH/akkoma.pgdump $AKKOMA_DBCONFIG_PATH | gpg -e -r 0 > $BACKUP_PATH/akbk+$(date +%Y%m%d-%H%M%S).tar.gz.gpg