Skip to content
Snippets Groups Projects
backup.md 914 B
Newer Older
  • Learn to ignore specific revisions
  • Rémi PAILHAREY's avatar
    Rémi PAILHAREY committed
    ## Principles
    
    In the docker-compose.yml, there is a service called "database-backup" whose only purpose is to run automatic backups of the database.
    
    It is running a crontab that execute the backup.sh script every day at midnight.
    
    The dump of the database are stored in folders name like this : "ecolyo-agent-YEAR-MONTH-DAY-HOUR-MINUTE-SECOND". Only the 14 last days are stored.
    
    The location of the backup folder on the server is specified in the volumes of the "database-backup" service, in the docker-compose file. 
    
    ## Backup manually
    
    To backup manually, run this command : 
    
    ```
    
    docker exec -it ecolyo-agent_database-backup_1 sh /etc/cron.d/backup.sh
    
    Rémi PAILHAREY's avatar
    Rémi PAILHAREY committed
    ```
    
    ## Restore manually
    
    To restore a specific dump, run this command replacing YEAR etc.. by the date of the wanted backup :
    
    ```
    
    docker exec -it ecolyo-agent_database-backup_1 sh /etc/cron.d/restore.sh ecolyo-agent-YEAR-MONTH-DAY-HOUR-MINUTE-SECOND
    
    Rémi PAILHAREY's avatar
    Rémi PAILHAREY committed
    ```