Comments (3)
Thanks for your input. I agree on the buffering of output, this can be dangerous. I'll change the code to not buffer the output and only pass it to the output handlers.
On output handlers, these are already available in master (have not released a new version yet) so adding events will not add any functionality, you can already capture and parse the output by assigning output handlers through the output
method. I'll add an example to the repository to demonstrate this.
I want to keep parsing the rsync command's output out of this library because the output is heavily dependent on how the command was build and with what options. It is not possible to set up output parsing for every possible combination of parameters so I want to leave that in the hands of the programmer who configured the command. The output handlers can be used to get the output and parse it for the configured command. Sending events should also be done from the implementing code if this is desired.
I'm still working out if exec is better than spawn, I think you want the sub-process to keep running when the main process is killed to prevent partially transferred file lists.
from node-rsync.
Okay the output handlers are fine for me.
But working with exec makes it very difficult to send SIGTERM or other kill-signals to rsync. NodeJS kills only the subshell (sh) and rsyn runs furthermore. AND exec everytime buffers all std(in|out)!
So i think using spwan is the only way to go. To be correct i think its good and necessarry to kill rsync if the main-process dies!
from node-rsync.
I can agree on the fact that spawn
would be better because of the buffering, but the argument that exec
makes sending SIGTERM signals to the process harder is kind of weak. It does not make it harder, it just makes it different. You can still use standard tools (like kill on Unix) to end the process, it's just not same as pressing CTRL-c to end the parent node process.
I will change the default behaviour to spawn
because the buffer point is valid and it's important to have solid default behaviour for the library. I do value the option to detach the process so it will keep running if the parent dies. I'll figure out another way to do this, probably with something like an executeDetached
method.
I'll try to update the code this week to use spawn
and hopefully release a new version. Thanks for your feedback.
cheers
from node-rsync.
Related Issues (20)
- Escaping $ in *nix platforms HOT 2
- Reporting --stats? HOT 1
- Rsync with password protected resources HOT 1
- File name escaping seems to fail HOT 7
- OnProgress event HOT 1
- transfer files from local to remote, prompt password HOT 1
- Allow overriding of environment variables being passed to child_process.spawn & rsync
- rsync hangs for unexpected time
- kill does not work HOT 3
- Support for --rsync-path HOT 1
- enhancement: custom streams
- Stderr goes to Stdout
- What is the time required to rsync a file? What is the speed I should expect ?
- How do I get progress output? Only seeing <Buffer ..... in stdout HOT 2
- Custom port ? HOT 2
- how to build a ‘-e’ option? HOT 1
- When I use rsync in winows system, there is an unsolvable error HOT 4
- huntr.dev - Code Injection HOT 2
- How to use a jump host in this library HOT 1
- cygwin path with space as source path does not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-rsync.