Skip to content

NFS Shares

Nautical itself does not have the ability to map network shares. However, it can use a network share for either the source or destination.

Commonly, we run containers on our host machine, then use an NFS share as the backup destination location. This page will give a brief overview of how to do that.

Connect to an NFS Share On Container Host (Linux)

  1. Create the NFS destination directories.

    # Create mount point (1)
    mkdir -p /mnt/nfs/docker_backups
    

    1. The destination directories must exist before a mount can be created
  2. Setup NFS mount points:

    nano /etc/fstab
    
    This will open a file, and here you can insert your NFS configuration:
    /etc/fstab
    # | ------------- Source -------------- | ---- Destination ---- | -------- Options ---------- |
    192.168.1.10:/mnt/backups/docker_volumes /mnt/nfs/docker_backups nfs _netdev,auto,rw,async 0 0
    
    Tip: 192.168.1.10 is just an example IP address

  3. Apply and mount the NFS shares

    mount -a
    

    A successful mount -a will return nothing in the console

  4. Verify read and write access

    cd /mnt/nfs/docker_backups
    touch test.txt && rm test.txt
    

Add Nautical Backup

The above example created a local directory of /mnt/nfs/docker_backups which is an NFS share pointing to 192.168.1.10:/mnt/backups/docker_volumes.

Here is how we can use this new mount withing Nautical:

services:
  nautical-backup:
    image: minituff/nautical-backup:2.9 #(7)!
    container_name: nautical-backup
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock #(1)!
      - /config:/config #(9)!
      - /source:/app/source #(2)!
      - /mnt/nfs/docker_backups:/app/destination #(3) <-- NFS Share
  1. Mount the docker socket. Used to start and stop containers. See the Docker Socket Proxy page for more information.
  2. Mount the source directory.
  3. Mount the destination directory.
  4. TIP: Avoid using "quotes" in the enviornment variables.
  5. Scheduled time to run backups. Use this website to help pick a CRON schedule.
    • Default = 0 4 * * * - Every day at 4am.
  6. Containers to skip for backup. A comma seperated list.
  7. It is recommended to avoid using the latest tag.
    • This project is under active development, using a exact tag can help avoid updates breaking things.
  8. Set the time-zone. See this Wikipedia page for a list of available time-zones.
  9. Configuration folder. This directory will will Nautical's internal database which stores metrics and history.
docker run -d \
  --name nautical-backup \
  -v /var/run/docker.sock:/var/run/docker.sock \ #(1)!
  -v /config:/config \ #(9)!
  -v /mnt/nfs/docker_backups:/app/destination \ #(2)!
  -e SKIP_CONTAINERS="example1,example2,example3" \ #(6)!
  minituff/nautical-backup:2.9 #(7)!
  1. Mount the docker socket. Used to start and stop containers. See the Docker Socket Proxy page for more information.
  2. Mount the source directory.
  3. Mount the destination directory.
  4. TIP: Avoid using "quotes" in the enviornment variables.
  5. Scheduled time to run backups. Use this website to help pick a CRON schedule.
    • Default = 0 4 * * * - Every day at 4am.
  6. Containers to skip for backup. A comma seperated list.
  7. It is recommended to avoid using the latest tag.
    • This project is under active development, using a exact tag can help avoid updates breaking things.
  8. Set the time-zone. See this Wikipedia page for a list of available time-zones.
  9. Configuration folder. This directory will will Nautical's internal database which stores metrics and history.