appnexus / sicksync

Don’t accept the available as the preferable. Go the extra mile with extra speed.
Apache License 2.0
68 stars 11 forks source link

Have a command executed on remote after sync? #54

Closed laggingreflex closed 7 years ago

laggingreflex commented 7 years ago

Would it be desirable to have an option to execute a command on remote after a successful sync?

Like I'm currently syncing /etc/nginx and would like to have nginx -s reload after each sync.

joelgriffith commented 7 years ago

This is definitely doable. I'd like to dust off this project a bit and get dependencies updated since it's been a while. Once that is complete then adding something like this should be fairly straightforward

joelgriffith commented 7 years ago

Thought about this some more, and I think this is likely better executed by consumers than sicksync as it opens up some security concerns. If a users' configuration is changed/compromised without them knowing then commands can be ran that could potentially be devastating. It's easy enough (I think) to write a small utility on the remote machine to do a file-system watch and run custom commands on it's own.

An example would be:

# Not 100% sure this works, but is a start
$ fswatch -o /etc/nginx | xargs nginx -s reload

Going back to first principles, sicksync is really just an aide in file syncronization, and I feel that change orchestration is better handled in user land.

I'm open to discuss this more if I'm missing something!

laggingreflex commented 7 years ago

I agree. I don't want this anymore.