server-docker icon indicating copy to clipboard operation
server-docker copied to clipboard

Add backup service

Open niclaslindstedt opened this issue 5 years ago • 8 comments

Backup all the demos & logs that are generated.

niclaslindstedt avatar Feb 22 '20 14:02 niclaslindstedt

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?

gfelisberto avatar Apr 20 '20 08:04 gfelisberto

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.

niclaslindstedt avatar Apr 20 '20 11:04 niclaslindstedt

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

gfelisberto avatar Apr 23 '20 21:04 gfelisberto

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.

eb avatar Sep 24 '20 22:09 eb

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

nvtkaszpir avatar Apr 11 '21 17:04 nvtkaszpir

I am writing the perfect backup image for this.

niclaslindstedt avatar Apr 13 '21 20:04 niclaslindstedt

and how it's going? ;)

nvtkaszpir avatar Sep 25 '21 21:09 nvtkaszpir

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

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

niclaslindstedt avatar Sep 27 '21 10:09 niclaslindstedt