This document outlines the standard operating procedure for backing up the Local Food AI application server (192.168.130.170).
The database contains all user accounts, parsed food profiles, and health parameters.
Automated Cron Backup Command:
# Execute as the db_owner using the mysql_config_editor login path
mysqldump --login-path=app_owner --single-transaction --routines --triggers food_db > /backup/mysql/food_db_$(date +\%F).sql
Zabbix Database Backup:
mysqldump --login-path=app_owner --single-transaction --routines --triggers zabbix > /backup/mysql/zabbix_$(date +\%F).sql
The Docker configuration, application code, and Taiga configurations must be backed up.
# Compress the entire project directory
tar -czvf /backup/app/food_project_$(date +\%F).tar.gz /home/francois/food_project/
# Backup Docker Compose configurations
tar -czvf /backup/docker/docker_configs_$(date +\%F).tar.gz /home/francois/food_project/docker/
A standard cron job should be configured to run daily at 03:00 AM local time.
To prevent disk exhaustion, backups older than 7 days should be automatically purged:
find /backup/mysql/ -type f -name "*.sql" -mtime +7 -exec rm {} \;
find /backup/app/ -type f -name "*.tar.gz" -mtime +7 -exec rm {} \;
To restore the database from a backup:
mysql --login-path=app_owner food_db < /backup/mysql/food_db_2026-04-30.sql
To restore the application:
tar -xzvf /backup/app/food_project_2026-04-30.tar.gz -C /
cd /home/francois/food_project/docker/app
docker-compose up -d