Fix Backup of precise files

Fix fetch and deploy
Added Data restoration
This commit is contained in:
DragoQC 2025-11-27 14:58:17 -05:00
parent c719285e67
commit e784ea0b70

View File

@ -35,13 +35,12 @@ function update_script() {
msg_ok "Stopped Service" msg_ok "Stopped Service"
msg_info "Creating Backup" msg_info "Creating Backup"
tar -czf "/opt/discopanel_backup_$(date +%F).tar.gz" "/opt/discopanel" tar -czf "/opt/discopanel_backup_last.tar.gz" -C "/opt/discopanel/data" discopanel.db .recovery_key servers
msg_ok "Created Backup" msg_ok "Created Backup"
rm -rf /opt/discopanel rm -rf /opt/discopanel
fetch_and_deploy_gh_release "discopanel" "nickheyer/discopanel" "tarball" "/opt/discopanel" fetch_and_deploy_gh_release "discopanel" "nickheyer/discopanel" "tarball" "latest" "/opt/discopanel"
msg_info "Building frontend" msg_info "Building frontend"
cd /opt/discopanel/web/discopanel cd /opt/discopanel/web/discopanel
@ -54,6 +53,10 @@ function update_script() {
go build -o discopanel cmd/discopanel/main.go go build -o discopanel cmd/discopanel/main.go
msg_ok "Builded backend" msg_ok "Builded backend"
msg_info "Restoring Data"
tar -xzf "/opt/discopanel_backup_last.tar.gz" -C "/opt/discopanel/data"
msg_ok "Restored Data"
msg_info "Starting Service" msg_info "Starting Service"
systemctl start discopanel systemctl start discopanel
msg_ok "Started Service" msg_ok "Started Service"