如何在Windows上获取rsync命令?

时间:2015-05-29 10:08:46

标签: windows node.js deployment rsync

我正在使用flightplan来部署我的node.js应用程序。 这是我的flightplan.js文件。

var plan = require('flightplan');

plan.target('default', {
    host: {{host}},
    username: {{ username }},
    port: '2222',
    agent: process.env.SSH_AUTH_SOCK
});

plan.local(function(local) {
    local.log('Copy files to remote hosts');
    var filesToCopy = local.exec('git ls-files', { silent: true });
    // rsync files to all the destination's hosts
    local.transfer(filesToCopy, '~/www/');
});

当我运行fly默认时,它停止并说

  

' rsync的'不被视为内部或外部命令

如何获取rsync命令?我正在运行Windows 8。

2 个答案:

答案 0 :(得分:9)

您可以安装免费版的cwRsync:

https://www.itefix.net/content/cwrsync-free-edition

例如,将所有文件解压缩到c:\ rsync,然后将c:\ rsync添加到路径中。

以下是在Windows上的路径中添加文件夹的教程:http://windowsitpro.com/systems-management/how-can-i-add-new-folder-my-system-path

答案 1 :(得分:0)

另一种方法是在 Windows 上使用 WSL 或 WSL2。 cwRsync 是 Cygwin 的一部分,它需要奇怪的路径才能工作。

相关问题