【问题标题】:How to get rsync command on windows? [closed]如何在 Windows 上获取 rsync 命令? [关闭]
【发布时间】:2015-08-12 03:48:53
【问题描述】:

我正在使用 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。

【问题讨论】:

  • Rsync 仅适用于基于 Linux 的操作系统。Windows 中没有 Rsync 命令

标签: windows node.js deployment rsync


【解决方案1】:

您可以安装免费版的 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

【讨论】:

  • 您也可以编写一个 Windows 1 行 rsync.bat“存根”(purely fowards 到带有 .exe 和伴随 dll 的 rsync 文件夹的命令),如下所示:C:\depot\script\rsync\rsync.exe %*。 — 只要将 .bat 放置在路径中的某个位置,就完成了。 :-)
【解决方案2】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-12
    • 1970-01-01
    • 2011-11-07
    • 1970-01-01
    • 2016-09-06
    • 1970-01-01
    • 1970-01-01
    • 2014-07-21
    相关资源
    最近更新 更多