[clug] A "How to" SSH question: copy file (scp/sftp) to remote system, then trigger a handler on remote.

Clinton Roy clinton.roy at gmail.com
Thu Jan 21 06:38:21 UTC 2016


On 21 January 2016 at 15:45, steve jenkin <sjenkin at canb.auug.org.au> wrote:

> I’m looking to move files to a remote system with ssh and have the copy
> trigger something to deal with them.


Are you running systemd on the server? If so, write a daemon that takes
it's listening socket as a command line argument (as in, let systemd do the
hard work, you just read/write to the passed fd) set up a service.socket
that contains:

[Socket]
ListenStream=/run/server

and a service.service that points to your service, make your ssh copy the
file to /run/server, and that should be it.

cheers,
-- 
Clinton Roy
Software Developer
Netboxblue.com
Total Internet Management
Control Internet usage within and outside your organisation.


More information about the linux mailing list