i am using Ubuntu 22.04 Server
i have installed my docker images in the following way:
All Docker Images are in # /home/myusername/docker/
Docker Images:
/home/myusername/docker/backrest
/home/myusername/docker/quacamole
/home/myusername/docker/itflow
/home/myusername/docker/rustdesk
etc.
All my Docker Images are Working Perfectly Including Backrest However i have a problem
Backrest: http://myubuntuserverip:9898
I am Trying to Backup my Docker Files and Database’s
I can create my Repositories with out any issues eg:
I have created this Repo and Have Tested it with the " Test Configuration " Option. Connected successfully to /backups and found an existing repo.
Repositories:
Repo Name = repo1
Repository URI = /backups
Password = MyPassword
Plans:
Plan Name = plan1
Repository = repo1
Paths = home/myusername/docker/itflow
When i submit " plan1 " For a Backup I get the Following ERROR!!
Failed to schedule backup: [unknown] failed to backup: path home/myusername/docker/itflow does not exist: stat home/myusername/docker/itflow: no such file or directory
When i use a leading slash as in “ /home/myusername/docker/itflow “ I Still get the Same Error
Please can you help in assisting me to do the Required Backups for my " ITFLOW "Data and Database
This error simply indicates that the path you are trying to back up does not exist:
Failed to schedule backup: [unknown] failed to backup: path home/myusername/docker/itflow does not exist: stat home/myusername/docker/itflow: no such file or directory
I’m not familiar with backrest. I am however familiar with docker, and I wonder if this is your problem. Is backrest running inside a docker container? or is it running natively on the host?
If it is running as a container, you need to mount the paths you want to backup into the backrest container, and the path as seen from inside the backrest container is the path you should be trying to back up, not the path as seen from the host.
@shd2h thank you for your support, much appreciated
q. If it is running as a container - I think so
you need to mount the paths you want to backup into the backrest container, and the path as seen from inside the backrest container is the path you should be trying to back up, not the path as seen from the host - How do i do this?
What i am confused about is that in the Backrest Repository that i created my “ Repository UI “ Points to “ /backups “ I created the Folder “ backups “ in my UBUNTU 22.04 Server Root to place my Backups there. When i do a Test with the Backrest Restic Repository ie: “ Test Configuration “ All is Good. No issues.
@itpilot can you share your docker compose file? Then we do not have to guess.
As @shd2h pointed out you need to make your host paths available to backrestic inside the docker container else it will not work.
I would also recommend to put the repository on a path that is available on the host outside the container. if you do ls /backups on your host, do you see the repo content?
When I look at the example backrestic docker compose file:
version: "3.8"
services:
backrest:
image: garethgeorge/backrest:latest
container_name: backrest
hostname: backrest
volumes:
- ./backrest/data:/data
- ./backrest/config:/config
- ./backrest/cache:/cache
- ./backrest/tmp:/tmp
- ./backrest/rclone:/root/.config/rclone # Mount for rclone config (needed when using rclone remotes)
- /path/to/backup/data:/userdata # Mount local paths to backup
- /path/to/local/repos:/repos # Mount local repos (optional for remote storage)
environment:
- BACKREST_DATA=/data
- BACKREST_CONFIG=/config/config.json
- XDG_CACHE_HOME=/cache
- TMPDIR=/tmp
- TZ=America/Los_Angeles
ports:
- "9898:9898"
restart: unless-stopped
then these two lines are the key to solve your problems:
- /path/to/backup/data:/userdata # Mount local paths to backup
- /path/to/local/repos:/repos # Mount local repos (optional for remote storage)
The left part /path/to/ is local on your host and need to be adapted.
Hope this clarifies.
If you can indicate what you think i need to place in the file in order to “ View / Backup “ my ITFLOW Data and Database to the Root of my UBUNTU Server “ /backups “
Thank you for your support, i’m starting to understand.
The same way you mount any kind of host data into a docker/OCI container - by bind mounting the local directory. The two lines @GuitarBilly identifies as “the key” are examples of this. (Docker documentation reference: Bind mounts | Docker Docs)
This is because the problem is not with your backup repository configuration. The problem is that backrest (restic) cannot read any of the data you want it to back up.
It isn’t the itflow container configuration that is the problem. @GuitarBilly didn’t state it explicitly, but IMO the backrest container is the configuration file we would need to see.
The crux of the issue is the backrest container cannot see any of the data on the host system, unless you specifically mount/expose it. This is by design, and is part of why containers are useful, they provide separation and isolation between the host system and the application running in the container.
This means that the paths that you are trying to back up, e.g. /home/myusername/docker/itflow, must be mounted to the backrest container. The application in the container cannot access them otherwise. This is why you get “this directory does not exist” errors when triggering backups.
You’re asking for a specific solution; you need to replace this line in the example backrest configuration file, tailor it to your specific needs, and then put it in your backrest configuration file. E.g.
volumes:
...
- /path/to/backup/data:/userdata # Mount local paths to backup
And then you need to configure backrest to backup /backupdata/itflow.
You need to do this for every directory you want to backup from the host file system.
To summarise:
If you do not explicitly mount a directory on the host to the backrest container, you cannot access it from inside the backup container.