A strange problem here.
Running rsync script call through ssh throws
"Permission denied (publickey). Rsync: connection unexpectedly closed (0 bytes received so far) [receiver]"
strange:
- ssh user @host works, so all ssh keys are configured correctly
- logging and inserting the command created by the script in the terminal works
- running whoami from the script shows the correct user, and the environment is passed to the spawn instance via process.env
- running ssh user @host from the script does not throw an error and returns a buffer, so it seems to work
running a script (which just runs an already verified command) will throw the above error
var spawn = require('child_process').spawn; spawn('rsync', [ '-avc', '--delete', '"'+src+'"' , '--link-dest="'+path.join(dest, folder_name)+'"', '"'+path.join(dest, 'latest/')+'"' ],{ cwd: process.cwd(), env: process.env });
source share