Sync files (Immich) to a NAS server

I’d really like to find a way to synchronise files from my Umbrel OS machine to a NAS share on my local network. I particular I’d like to sync my Immich DB backups and also the Immich image/video folder.

Has anyone achieve this somehow?

1 Like

Maybe you can try with Syncthing

You could use a script (.sh) that runs at a set interval using crontab, and that uses rsync.

Here’s an example I use.
In my case, the script is executed from the backup side, pulling data from Umbrel. But it could also work the other way around. For authentication, you can use sshpass as shown in the example, though you could also use your private keys for better security.

echo “Syncing Immich data, be patient…” sshpass -p “umbrelpassword” rsync -av --delete umbrel@umbrel.local.ip:/home/umbrel/umbrel/app-data/immich/data/ /directory/for/your/backup/data/

Again, this example is meant to be run from the backup server side. You would need to reverse the order of the directories and the IP address if you want to run it from Umbrel instead.

In the case you want to restore your data into your umbrel, you have to copy the data folder from your backup to the umbrel and that’s all.

When doing backups, rsync will compare the files in the source and destination directories, delete files from the destination that no longer exist in the source, and copy only the new files from the source that don’t exist in the destination. I find it very efficient.

Hope this helps.
Ask anything you need and welcome.

1 Like