Backing up to external drive!

Firstly - I’m very, very new to Docker!

I’ve installed Urbackup on my Linux laptop as a container. It works, but the backup data is stored within the container on /media/BACKUP/urbackup, which is not where I would like it. I want to store backups on an external drive (doesn’t everyone?), and am currently using a USB stick for experimental purposes - /media/jim/3F21-4AFB, mounted on the host laptop.

It seems that it’s not quite straightforward to write backups to a location on the host machine, and a search came up with this command

docker run -t -i -v /media/jim/3F21-4AFB/:/media/BACKUP/urbackup ubuntu /bin/bash

Which appears to link the container location to the host location.

I tentatively tried it, but nothing gets written to the USB stick.

I’d be grateful for a bit of handholding, please!
Jim

docker run -d --name urbackup-server-1 -v /media/backups:/backups -v /media/database:/var/urbackup -p 55413-55415:55413-55415 -p 35623:35623/udp uroni/urbackup-server

replace /media/ with the base path on your local filesystem, i.e /media/jim/3F21-4AFB/

https://www.urbackup.org/download.html#server_docker

Thanks for the reply ‘macom’.

Hmm - it looks like maybe urbackup isn’t for me!
I was attracted to it because installation and the Web UI configuration looked quite straightforward - and it was up to a point, but as soon as you need to depart a fraction from the defaults you’re up to your neck in obscure docker features and cryptic commands that make SED commands and APL code look as clear as spring water!
Jim

If you do not feel comfortable with docker you can still install it on you OS without docker.

Ultimately I may end up installing it without docker, but I see the advantage of docker and will try to get my head around it. But new concepts don’t come easily at my age!
Jim

Docker can be a bit confusing to get started with but it really isn’t that hard - here is a breakdown of that command line for you:

  • run <-- “run” is a terrible command name - it actually builds a brand new container and then starts it
  • -d <-- use daemon mode instead of running in foreground mode
  • --name urbackup-server-1 <-- give the running container a nice name
  • -v /media/backups:/backups <— mount host direcotry /media/backups inside the container as /backups
  • -v /media/database:/var/urbackup <— mount host directory /media/database inside the container as /var/urbackup (configuration lives here)
  • -p 55413-55415:55413-55415 <-- forward host TCP ports 55413-55415 to the container TCP ports 55413-55415
  • -p 35623:35623/udp <-- forward host UDP port 35623 to container UDP port 35623
  • uroni/urbackup-server <-- image to use for building the container

Additionally - you’ll probably want

  • --restart unless-stopped <-- set the restart policy on the container to ensure it is restarted when you reboot your host

After the container is created, you can use docker start|stop urbackup-server-1 to manually start or stop the newly created container.

1 Like