r/immich • u/thehatefuleggplant • 1h ago
A tale of caution when using storage templates.
Im sure a bunch of folks are using storage templates but there could be a hidden nightmare.
In my case I take 321 backups to the nth degree so Im likely a bit of an edge use case but wanted to warn anyone who may run into the same issues that I have.
My backup strategy is a nightly restic backup to pcloud, backblaze, an external USB drive, and two seafile servers as well as a backup script being run from the user systemd services that looks for any changes in the upload folder of immich and sync's those changes to the USB drive and the two seafile servers.
The idea is to have multiple true backups with multiple carbon copies of the raw data. With the raw data in seafile I can very easily keep file changes documented since seafile has a nice web interface and keeps version history of the data should I need to restore a single deleted photo or video. The USB drive is just in case I die tomorrow my wife can simply take the USB drive, plug it into another computer and have easy access to all our photos.
My storage template should have looked something like this. {{y}}/{{filetypefull}}/{{filename}} resulting in the file directory structure UPLOAD_LOCATION/library/admin/2022/IMAGE/IMAGE_56437.jpg
However when I initially set up storage templates there was a space between the folder name and the file name so it actually looked like this. {{y}}/{{filetypefull}} /{{filename}} which ends up looking something like this UPLOAD_LOCATION/library/admin/2022/IMAGE /IMAGE_56437.jpg
In my original configuration there was a space being added between "image /filename" or "video /filename"
Under normal file and restic backup operations it didnt seem to make much difference. Restic backups didnt care about that extra space at all.
My rclone sync job ran into issues though.
The sync job to the USB drive went fine as ext4 doesnt seem to care about that space or ignores the extra space but the seafile servers took extra issue with that config as the sync job was adding an extra byte of data to the synchronized files and causing errors.
For most this maybe a non issue but I felt maybe there could be someone who have made the same mistake that I did.
