2024-10-13, 03:40 AM
(This post was last modified: 2024-10-13, 04:13 AM by alleycat. Edited 3 times in total.)
(2024-10-13, 01:11 AM)TheDreadPirate Wrote: The way mine works is by writing to a temporary "backup" directory on my NVMe drive. This minimizes down time. Once the backup completes to the NVMe drive I start up my containers and then it starts writing the backup to the hard drive for storage.
I use rsync because it has an option (--delete) to clean up files in the "destination" folder that are no longer present in the "source". This helps prevent the backup from bloating with files that no longer exist.
Update the three path variables at the top with where your files are located.
BACKUPDIR = the temp path you are moving files to. Preferably the path is on a fast SSD.
DOCKERDIR = the root path for where all your docker data is located.
STORAGEDIR = the path for permanent backup storage.
Code:#!/bin/bash
BACKUPDIR=/root/backup
DOCKERDIR=/docker/containers
STORAGEDIR=/media/library/backup
mkdir -p $BACKUPDIR
mkdir -p $BACKUPDIR/docker
cd $DOCKERDIR
docker compose down
rsync -a -p --progress . $BACKUPDIR/docker/ --delete
docker compose up -d
mkdir -p $STORAGEDIR
rsync -a -p --progress $BACKUPDIR/docker $STORAGEDIR --delete
Then I have duplicati running as a service that pushes the storage backup folder to Google Drive.
My containers, not just jellyfin, are down for about 5-7 seconds since rsync essentially does a "diff" backup. The initial backup will take longer.
I thank you for the reply and script example. My standalone Jellyfin server (Dell 7050) runs Ubuntu 24.04 (bare metal) and I installed the Jellyfin repo straight to it, thats the only software on this machine. I don't think I'm running Docker or Flatpacks on the Dell. I was hoping to rsync Jellyfin data from the Dell to a dataset on my Truenas Mini X+, which is another machine.
This is how I installed Jellyfin from the docs:
curl https:// repo.jellyfin.org/install-debuntu.sh | sudo bash
.
Jellyfin 10.10.3 (bare metal), Ubuntu 24.04.1 LTS 6.8.0-49-generic (bare metal)
Dell OptiPlex 7050, Intel i7-6700 4.0GHz, 32GB ram, OS 1TB NVMe,
Intel Arc A310 ELF, Storage: TrueNas Scale 21TiB (Samba shares),
PFsense/HAproxy
Jellyfin 10.10.3 (bare metal), Ubuntu 24.04.1 LTS 6.8.0-49-generic (bare metal)
Dell OptiPlex 7050, Intel i7-6700 4.0GHz, 32GB ram, OS 1TB NVMe,
Intel Arc A310 ELF, Storage: TrueNas Scale 21TiB (Samba shares),
PFsense/HAproxy