nQuake / server-docker

QuakeWorld server package running on Docker
16 stars 6 forks source link

Add backup service #1

Open niclaslindstedt opened 4 years ago

niclaslindstedt commented 4 years ago

Backup all the demos & logs that are generated.

gfelisberto commented 4 years ago

As the the demos and logs are placed in docker volumes there is no "clean" way of getting them. There seems to be two options:

  1. Doing a docker exec in the container and compressing the logs and then getting them out with docker cp but this requires the container to be running
  2. Getting the logs directly from /var/lib/docker/volumes/nquakesv_* but that needs the backup process to have super user rights

What do you guys like best?

niclaslindstedt commented 4 years ago

The clean way imo is to have a backup service specified in the docker-compose.yml that mounts the media folders AND a backup folder from the host, and copies the files over there.

gfelisberto commented 4 years ago

https://github.com/gfelisberto/nquakesv-backup

I already updated my local docker-compose to include this but wanted to discuss better before going forward.

Currently I am doing a rsync for the demos because the files are not changed. But for the logs as we may get a new container with new files and the same name I opted for doing a full tar.bz2

eb commented 4 years ago

I think the right thing to do here would be to use bind mounts in the docker-compose.yml, instead of volumes. E.g.

      - ./nquake/logs:/nquake/logs
      - ./nquake/media:/nquake/media
      - ./nquake/demos:/nquake/demos

So, whereever the user chooses to put his docker-compose.yml, demos, logs and media would live right alongside of it.

nvtkaszpir commented 3 years ago

Another idea is to add extra container to export data outside of the stack, for example periodic rclone or synthing.

niclaslindstedt commented 3 years ago

I am writing the perfect backup image for this.

nvtkaszpir commented 3 years ago

and how it's going? ;)

niclaslindstedt commented 3 years ago

I'm done with the image. I just need to add it to this project :)

https://github.com/niclaslindstedt/docker-backup