[arch-general] inotify and rsync as user

siefke_listen at web.de siefke_listen at web.de
Sat May 2 09:42:37 UTC 2020


Hello, 

I have question to the combination of inotify and rsync. I want that my
documents folder sync with other maschine if the host is up. So I find 
this soulution in net. 

The problem is, I write a script take it in /usr/local/bin 

cat /usr/local/bin/sync_docs.sh 
#!/usr/bin/env bash

if ping -c 1 192.168.2.160 &> /dev/null; then
	while true; do
		inotifywait -r -e modify,attrib,close_write,move,create,delete /home/siefke/Dokumente
		rsync -avuq /home/siefke/Dokumente/ samsung:/home/siefke/Dokumente/
	done
fi

and a systend service file. So but when the script run I become ever error

siefke at 192.168.2.160: Permission denied (publickey,password).

So I place the script in home folder, place systemd service file in home and
run it with systemd --user. 

The result is same. When run ssh samsung it works, when I run sync_docs.sh in
shell it works. Why with systemd make it trouble?

Thank you 
Silvio 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/arch-general/attachments/20200502/810faa44/attachment.sig>


More information about the arch-general mailing list