如何在Windows上获取rsync命令?

9

我正在使用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 default命令时,它停止并显示:

'rsync'不是内部或外部命令

我该如何获得rsync命令?我正在运行Windows 8操作系统。


1
Rsync仅适用于基于Linux的操作系统。Windows中没有Rsync命令。 - Billy
2个回答

14

只要将Windows 1行的“rsync.bat”“存根”(一个纯粹转发到带有.exe和相应dll的rsync文件夹的命令)编写如下:C:\depot\script\rsync\rsync.exe %*,并将其放置在路径中的任何位置,就可以完成。 :-) - Frank N

0

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接