inotify and rsync as user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@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 

Attachment: pgpEuaALdHdls.pgp
Description: PGP signature


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux