I've been really struggling for a few days trying to get a node.js script to work on the linux distribution offered on the intel Galileo board. I am using the full size distro provided for use on the SD card, and I have used:
'npm install rsync'
to install the node.js rsync. I am trying simply to test the functionality based on the example given at the npm site. Here is what I am using:
-#!/usr/bin/node
var Rsync = require('rsync');
// Build the command
var rsync = new Rsync()
.flags('az')
.source('/home/root/documents')
.destination('/home/root/documents_backup');
// Execute the command
rsync.execute(function(error, code, cmd) {
// we're done
});
cmd = new Rsync()
.flags
.source
I go to the terminal, open the directory it is saved in, and type node test.js. The line "All done executing" is shown, but there are no files from "documents" in "documents_backup."
Does anyone know why this script is not working correctly?
Or how to correctly use the node.js version of rsync.
I can't seem to have any luck getting a linux distro with gcc to compile and install rsync on the galileo board, so I am afraid this may be as close as I can get to it.
Thanks in advance.
Thank you for clearing things up in your comment.
The issue, is that rsync
is rather a huge project, and there is little reason to implement rsync
from the ground in Node.js, granted it is easily accessible and is available on almost all platforms.
It is not a surprise, that rsync
module for Node.js is just a wrapper. Taken from NPM rsync:
Rsync is a class for building and executing rsync commands with Node.js.
As Galileo does not have rsync
installed by default, the module is of no use.
Alternatively, there seem to be few articles on how to install Debian and other full-featured linux distributions, though it seems to be rather a challenge.
Finally, rsync is double-sided program, you can instead configure rsync
on the other end, and
tell it to use SSH instead of rsync protocol for communicating with your Galileo server.