diff --git a/auto-fix-qortal.sh b/auto-fix-qortal.sh index 2a71a5f..c20229e 100644 --- a/auto-fix-qortal.sh +++ b/auto-fix-qortal.sh @@ -389,6 +389,23 @@ potentially_update_settings() { fi ### Step 4: Rotate backups (keep 2 newest) ### + + echo "${YELLOW}Rotating old backups (keeping only 2)...${NC}" + cd "${BACKUP_FOLDER}" || exit 1 + + backup_count=$(ls -1 backup-settings-*.json 2>/dev/null | wc -l) + + if [ "$backup_count" -gt 2 ]; then + # List oldest first, delete all but the 2 most recent + for old_backup in $(ls -1tr backup-settings-*.json | head -n -$((backup_count - 2))); do + echo "Deleting old backup: $old_backup" + rm -f "$old_backup" + done + else + echo "${BLUE}No old backups to delete.${NC}" + fi + + cd - >/dev/null || exit 1 echo "${GREEN}Settings file is now valid. Proceeding...${NC}" cd || exit 1 diff --git a/rebuilt-machine.sh b/rebuilt-machine.sh index 21c03d5..e95b91f 100644 --- a/rebuilt-machine.sh +++ b/rebuilt-machine.sh @@ -93,6 +93,7 @@ curl -L -O https://raw.githubusercontent.com/crowetic/QORTector-scripts/main/aut curl -L -O https://raw.githubusercontent.com/crowetic/QORTector-scripts/main/check-qortal-status.sh curl -L -O https://raw.githubusercontent.com/crowetic/QORTector-scripts/main/start-qortal.sh curl -L -O https://raw.githubusercontent.com/crowetic/QORTector-scripts/main/start-qortal-core.sh +curl -L -O https://cloud.qortal.org/s/machinefilesnew/download chmod +x *.sh unzip download