fix
again
This commit is contained in:
parent
f4365e51e9
commit
bb8ca54010
@ -389,15 +389,6 @@ potentially_update_settings() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
### Step 4: Rotate backups (keep 2 newest) ###
|
### Step 4: Rotate backups (keep 2 newest) ###
|
||||||
echo "${YELLOW}Rotating backups (keeping only 2 most recent)...${NC}"
|
|
||||||
BACKUPS=($(ls -1t "${BACKUP_FOLDER}"/backup-settings-*.json 2>/dev/null))
|
|
||||||
if [ "${#BACKUPS[@]}" -gt 2 ]; then
|
|
||||||
OLD_BACKUPS=("${BACKUPS[@]:2}") # All but first two
|
|
||||||
for old in "${OLD_BACKUPS[@]}"; do
|
|
||||||
echo "Deleting old backup: ${old}"
|
|
||||||
rm -f "${old}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "${GREEN}Settings file is now valid. Proceeding...${NC}"
|
echo "${GREEN}Settings file is now valid. Proceeding...${NC}"
|
||||||
cd || exit 1
|
cd || exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user