BretFisher / docker-vackup

Script to easily backup and restore docker volumes
The Unlicense
383 stars 68 forks source link

Question to use the backup script? #7

Closed killmasta93 closed 2 years ago

killmasta93 commented 2 years ago

Hi Currently looking at your script but i was wondering if you can shed some light on the issue, I would need to backup a docker container and import it another host,

reading the readme there is export volume file, import file volume,

in my case i need to export the volume which is located in /openvas then import it on another Host

but couldn't really understand how to do it with this script

Thank you

this is my current docker-compose file


version: "3"
services:
  openvas:
    ports:
      - "8080:9392"
    environment:
      - "PASSWORD=xxxxxx"
      - "USERNAME=admin"
      - "RELAYHOST=172.17.0.1"
      - "SMTPPORT=27"
      - "REDISDBS=512" # number of Redis DBs to use
      - "QUIET=false"  # dump feed sync noise to /dev/null
      - "NEWDB=false"  # only use this for creating a blank DB 
      - "SKIPSYNC=true" # Skips the feed sync on startup.
      - "RESTORE=false"  # This probably not be used from compose... see docs.
      - "DEBUG=false"  # This will cause the container to stop and not actually start gvmd
      - "HTTPS=false"  # wether to use HTTPS or not
      - "GMP=9390"    # to enable see docs
    volumes:
      - "/openvas:/data"
    container_name: openvas
    image: immauss/openvas:latest
  scannable:
    image: immauss/scannable
    container_name: scannable
volumes:
  openvas:
BretFisher commented 2 years ago

That's a bindmount, so docker doesn't create a named volume for it (openvas wouldn't be listed in docker volume ls). vackup doesn't do bindmounts since they are unmanageed.

killmasta93 commented 2 years ago

thanks for the reply, so in this case the backup procedure would just copy the files?

BretFisher commented 2 years ago

I guess the point is, if you're bind-mounting, the files are in a place you control, which means you would control how they are backed up. vackup is really for getting files out of a volume that's only available in a container, making it harder to get at those files for backing them up.

killmasta93 commented 2 years ago

thank you i think i figured it out i converted all my docker bindmounts to volumes

curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo bash

Thank you