Compare commits
6 Commits
feat/odoo-
...
57284c07d4
| Author | SHA1 | Date | |
|---|---|---|---|
| 57284c07d4 | |||
| 47e015c0cc | |||
| 141907b6d9 | |||
| 56b69f5fe2 | |||
| 90e1c61138 | |||
| a6bd4e2e87 |
38
.gitignore
vendored
38
.gitignore
vendored
@@ -16,7 +16,39 @@
|
|||||||
# exclude the certificates config folder
|
# exclude the certificates config folder
|
||||||
/config/traefik/dynamic/*
|
/config/traefik/dynamic/*
|
||||||
!/config/traefik/dynamic/.gitkeep
|
!/config/traefik/dynamic/.gitkeep
|
||||||
|
|
||||||
|
# Python cache/bytecode
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
.DS_Store
|
.DS_Store
|
||||||
secrets
|
secrets/
|
||||||
Persistent Backup
|
|
||||||
backups/*
|
# Backup files and directories
|
||||||
|
/backups/
|
||||||
|
*.tar.gz
|
||||||
|
*.sql.gz
|
||||||
|
*.sql
|
||||||
|
Persistent Backup/
|
||||||
|
|
||||||
|
# Python cache
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
*.egg-info/
|
||||||
|
|
||||||
|
# Database files
|
||||||
|
*.db
|
||||||
|
*.sqlite
|
||||||
|
*.sqlite3
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Editor settings
|
||||||
|
.vscode/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*~
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
Thumbs.db
|
||||||
|
|||||||
@@ -13,5 +13,5 @@
|
|||||||
"views/mrp_lot_mix_views.xml",
|
"views/mrp_lot_mix_views.xml",
|
||||||
],
|
],
|
||||||
"installable": True,
|
"installable": True,
|
||||||
"application": False,
|
"application": True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,8 +150,11 @@ cleanup_old_backups() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
# Prepare dated backup directory
|
# Prepare dated backup directory using a stable run timestamp.
|
||||||
DATED_DIR="$BACKUP_BASE/$(date_formatted)"
|
# This prevents later steps from missing files if the minute changes while
|
||||||
|
# long archive operations are running.
|
||||||
|
RUN_STAMP="$(date_formatted)"
|
||||||
|
DATED_DIR="$BACKUP_BASE/$RUN_STAMP"
|
||||||
mkdir -p "$DATED_DIR"
|
mkdir -p "$DATED_DIR"
|
||||||
|
|
||||||
wait_for_database_backups || exit 1
|
wait_for_database_backups || exit 1
|
||||||
@@ -188,7 +191,22 @@ log "Moving files from database dump to dated directory..."
|
|||||||
#log "Files to move:"
|
#log "Files to move:"
|
||||||
ls -1 "$BACKUP_BASE/databases"/* 2>/dev/null || true
|
ls -1 "$BACKUP_BASE/databases"/* 2>/dev/null || true
|
||||||
log "Moving database dumps to dated directory..."
|
log "Moving database dumps to dated directory..."
|
||||||
mv "$BACKUP_BASE/databases"/*_$(date_formatted)*.sql.gz "$DATED_DIR"/ 2>/dev/null || true
|
|
||||||
|
dump_moved=0
|
||||||
|
for dump_file in "$BACKUP_BASE/databases"/*_"$RUN_STAMP"*.sql.gz; do
|
||||||
|
[ -e "$dump_file" ] || break
|
||||||
|
if mv "$dump_file" "$DATED_DIR"/; then
|
||||||
|
dump_moved=$((dump_moved + 1))
|
||||||
|
else
|
||||||
|
err "Failed to move database dump $dump_file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$dump_moved" -eq 0 ]; then
|
||||||
|
log "No database dumps matched run timestamp $RUN_STAMP"
|
||||||
|
else
|
||||||
|
log "Moved $dump_moved database dump(s) to $DATED_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
cleanup_old_backups
|
cleanup_old_backups
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user