Installation
Adding remote hosts
How to initialize a new remote host for fsbackup and add it to targets.yml.
Each machine fsbackup backs up needs a backup user with the fsbackup SSH public key and rsync installed.
Initialize the remote host
Copy remote/fsbackup_remote_init.sh to the target machine and run it as root:
sudo ./fsbackup_remote_init.sh \
--pubkey-file /var/lib/fsbackup/.ssh/id_ed25519_backup.pub
This script:
- Creates the
backupuser (system user, no login shell) - Installs the SSH public key in
~backup/.ssh/authorized_keys - Restricts SSH to rsync-only via
command=inauthorized_keys - Installs rsync if not present
Trust the host key
Back on the backup server:
docker exec -it fsbackup /opt/fsbackup/utils/fs-trust-host.sh <hostname>
Add targets to targets.yml
Edit /etc/fsbackup/targets.yml to add targets for the new host. See Targets configuration for the full format.
Example — backing up /etc/nginx from a host called rp:
class2:
- id: rp.nginx.config
host: rp
source: /etc/nginx
type: dir
Verify
docker exec -it fsbackup /opt/fsbackup/bin/fs-doctor.sh --class class2
The new target should show OK. If it shows FAIL, check SSH connectivity:
sudo -u fsbackup ssh backup@rp echo ok
Local paths (Docker)
For paths on the backup server itself, use host: localhost in the target definition. The path must be bind-mounted into the container:
class1:
- id: myapp.data
host: localhost
source: /docker/volumes/myapp_data
type: dir
And in docker-compose.yml:
volumes:
- /docker/volumes/myapp_data:/docker/volumes/myapp_data