Backup Docker data and settings?

  • Hi,


    I've installed Docker on another SSD drive, following the guide "How to Prepare OMV to install docker applications".

    This SSD drive will contain "docker" and "config" directories/data only


    As I read, there is no benefit to do a full backup of this SSD drive.

    Thus I plan to create a Scheduled Job in OVM to backup each volume (stopping the containers during backup), as explain in this post.


    Can I use rsnapshot plugin to do these volumes backup?


    Do I have to backup others files/directories from this SSD drive?


    Thank you,

    Chris

  • you need to backup the config of the containers as well and do this in sync with the volumes.


    Rsync/rsnapshot should work, but is not the recommended way.


    Remember: you do not have a valid backup until you restored it.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

    • Official Post

    you need to backup the config of the containers as well and do this in sync with the volumes.


    Rsync/rsnapshot should work, but is not the recommended way.


    Remember: you do not have a valid backup until you restored it.

    Very true. Personally what Zoki describes above, while maybe not "recommended" is what I do. I do not run the job automatically however. Since important data (ie, media) is outside of my containers, and my /config directories are all outside of the containers folder... I usually just do it when I know I've made major changes to my containers. Maybe once a month. Easiest way I've found to do this, with rsync and the simple cp command. Obviously how everyone has their data, their drives set up, etc.. is different. Mine... All of my data on "Drive A" is pretty much what serves everything. Drive B is a backup.


    1. Stop docker

    2. Create an rsync job that backs up my "config" folder (on Drive A), to a "backup-config" folder (on drive B)... and let that run. This job runs manually only and is not scheduled. Most of the time this job will finish in less than 5min.

    3. For my containers folder, I just use the "cp" command. I could use rsync, etc.. but usually I just cp. I usually date the folder name so I know what date it was done... I keep my containers in a folder called 'Containers' (on Drive A). So I just SSH in as root and it looks something like this.


    cp -R /DriveA/Containers /DriveB/Containers-1922


    That would mean the Containers folder on Drive B, was last backed up on 1/9/22. Since this is when I backup my /config directories as well, it also tells me when they were last backed up. Depending on the size of my Containers folder, this one usually takes 10-15min.


    At some point on the overnight hour, Syncthing will run and backup my "Containers-Date" , as well as my "backup config" folder on Drive B, to my remote backup.


    I tested/restored with this procedure MULTIPLE times before I was comfortable with it as a backup and while it is not 100% automated, I don't really need that.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!