trigger command on successful upload?

Tim Conway conway at us.ibm.com
Tue Jun 15 14:22:14 GMT 2004


If you're rsyncing over an external transport, I can't imagine what the 
issue is in running a postprocessing command over the same transport. But, 
if what you're looking for is a way to do this over rsync internal 
transport, and want to get rid of the remote shell, perhaps for security 
reasons, leave a daemon, or perhaps a cron-driven script, to watch for the 
appearance of a trigger file.  If the rsync transfer finishes correctly, 
you send up the trigger file, which is harvested by the receiver, which 
performs the desired post-transfer processing.
start pseudoscript:+++++++++++++++++++++++++++++++++++++++++++
[ -f "$triggerfile" ] || exit 0
rm $triggerfile
perform whatever it is you wanted
end pseudoscript:+++++++++++++++++++++++++++++++++++++++++++
Cronjob:
* * * * * /path/to/the/script

Tim Conway
Unix System Administration
Contractor - IBM Global Services
desk:3032734776
conway at us.ibm.com


I would like to be able to trigger a script for #3 instead of having
to ssh over (to make the frontend server a bit more autonomous, and 
simplify the process).

Does this seem reasonable, or am I just making things more complex
for myself? :)


More information about the rsync mailing list