Results 1 to 2 of 2
I'm confused. Totally.
I have a file that needs to be backed up every time it changes, so I set up an incrond job to rsyc the file to a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-02-2012 #1Just Joined!
- Join Date
- Jun 2008
- Posts
- 12
crond works but incrond doesn't
I'm confused. Totally.
I have a file that needs to be backed up every time it changes, so I set up an incrond job to rsyc the file to a remote server - SSH keys setup and all that. However, the file is never updated on the remote server after changes are made, even though the incrond event fires.
incrontab -e
Event fires - /var/log/cron:Code:/opt/sap/conf/sitelists/ IN_CLOSE_WRITE rsync --delete -avze 'ssh -p 2595' /opt/sap/conf/sitelists root(a)<server>:/var/flexshare/shares/sap_businesses/TowncoFuels
But the file on the remote server is not updated with the new content. On a lark, I decided to try the same command in cron.Code:Nov 2 16:13:09 system incrond[23896]: (root) CMD (rsync --delete -avze 'ssh -p 2595' /opt/sap/conf/sitelists root(a)<server>:/var/flexshare/shares/sap_businesses/TowncoFuels)
crontab -e
Crontab fires - /var/log/cron:Code:*/3 * * * * rsync --delete -avze 'ssh -p 2595' /opt/sap/conf/sitelists root(a)<server>:/var/flexshare/shares/sap_businesses/TowncoFuels
And VOILA, the remote server shows the new content. I'm baffled.Code:Nov 2 16:15:01 system crond[28036]: (root) CMD (rsync --delete -avze 'ssh -p 2595' /opt/sap/conf/sitelists root(a)<server>:/var/flexshare/shares/sap_businesses/TowncoFuels)
P.S. Excuse the (a) replacement for the AT sign. I haven't made my 15 posts yet.
- 11-03-2012 #2Just Joined!
- Join Date
- Jun 2008
- Posts
- 12
Well, update here. If I put the rsync job in a shell script and call the script, things work. That's satisfactory enough; just puzzled why the ring-around-the-rosy with only the direct rsync command. Hope this helps someone...


Reply With Quote
