Back to articles
NAS sync with lsyncd and rsync: what was not working and how I fixed it
How-To

NAS sync with lsyncd and rsync: what was not working and how I fixed it

via Dev.toUrban

I wanted a simple setup: my PC syncs files to my Synology NAS in real-time, one-way, no deletions. How hard could it be? Turns out: hard enough that I built a tool to generate the setup script automatically - nas-sync-script-builder - because there were too many moving parts to get right by hand. Here is what was not working, and how I fixed each one. 1. lsyncd started before my drives were even mounted My initial setup used the drives as they were automatically mounted by Dolphin (KDE file manager) at /media/<user>/<partition-label> . Made sense - the drives show up in Dolphin, they're mounted, done. lsyncd didn't agree. The problem is where in the boot sequence each mechanism fires: local-fs.target ← /etc/fstab mounts happen here ↓ multi-user.target ← lsyncd.service starts here ↓ graphical.target ↓ KDE session starts ↓ udisks2 + Dolphin → /media/<user>/<label> ← drives mounted HERE lsyncd is a system service. It starts at multi-user.target , long before any user session exists. Dolph

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles