AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 498836
Accepted
Miguel Mesquita Alfaiate
Miguel Mesquita Alfaiate
Asked: 2019-02-06 08:04:06 +0800 CST2019-02-06 08:04:06 +0800 CST 2019-02-06 08:04:06 +0800 CST

将远程 Linux 服务器备份到 Windows

  • 772

我想将远程 linux 服务器备份到 windows 工作站。

我正在寻找与此类似的方法,但在 Windows 中:从远程服务器备份

是否有任何我可以使用的 Windows rsync 客户端,或者任何在下面使用 rsync 的 GUI 应用程序?我需要能够使用 SSH 密钥进行连接,并让它每天运行以将远程文件同步到 Windows 机器中。

linux windows
  • 2 2 个回答
  • 2182 Views

2 个回答

  • Voted
  1. Best Answer
    BowlOfRed
    2019-02-06T11:06:47+08:002019-02-06T11:06:47+08:00

    Cygwin 具有 openssh(客户端和服务器)和 rsync,因此您当然可以使用它来创建一个 rsync 目标,就像在 linux 上一样。

    我主要担心的是文件系统问题。Rsync 尝试同步元数据,而不是在单独的位置捕获它(喜欢tar或zip会这样做)。这意味着元数据与目标文件系统不兼容的地方,你会遇到问题。

    • 两台机器上的用户可能不同
    • NTFS 文件名比大多数 linux 文件系统有更多的限制。
    • 我不知道如果 rsync 在 NTFS 上请求设备特殊文件会发生什么。

    如果您尝试通过没有任何奇怪名称且所有权/权限不是什么大问题的网络文件夹进行同步,那么它应该可以正常工作。如果您正在尝试同步 linux 根文件系统并希望保留所有设备和权限,我认为 rsync 到 Windows 上可能会更成问题。

    另一种方法是在 Windows 服务器内运行 linux VM。然后,您可以根据需要配置 VM。如果它只做一些非工作时间的文件传输,并且您有足够的 RAM,那么它根本不会影响 windows 服务器的性能。

    • 2
  2. ron
    2019-02-06T13:39:02+08:002019-02-06T13:39:02+08:00

    rsnapshot.conf

    #################################################
    # rsnapshot.conf - rsnapshot configuration file #
    #################################################
    
    config_version  1.2
    
    # All snapshots will be stored under this root directory.
    #
    # what ron uses
    
    snapshot_root   /bkup/private/
    
    # If no_create_root is enabled, rsnapshot will not automatically create the
    # snapshot_root directory. This is particularly useful if you are backing
    # up to removable media, such as a FireWire or USB drive.
    #
    no_create_root 1
    
    #################################
    # EXTERNAL PROGRAM DEPENDENCIES #
    #################################
    
    # LINUX USERS:   Be sure to uncomment "cmd_cp". This gives you extra features.
    # EVERYONE ELSE: Leave "cmd_cp" commented out for compatibility.
    #
    # See the README file or the man page for more details.
    #
    cmd_cp         /bin/cp
    
    # uncomment this to use the rm program instead of the built-in perl routine.
    #
    cmd_rm          /bin/rm
    
    # rsync must be enabled for anything to work. This is the only command that
    # must be enabled.
    #
    cmd_rsync       /usr/bin/rsync
    
    # Uncomment this to enable remote ssh backups over rsync.
    #
    #cmd_ssh        /usr/bin/ssh
    
    # Comment this out to disable syslog support.
    #
    cmd_logger      /bin/logger
    
    # Uncomment this...
    # Uncomment that... 
    
    #########################################
    #     BACKUP LEVELS / INTERVALS         #
    # Must be unique and in ascending order #
    # e.g. alpha, beta, gamma, etc.         #
    #########################################
    
    # retain  alpha   6
    # retain  beta    7
    # retain  gamma   4
    # retain  delta   3
    
    # what ron uses, daily non-incremental backup via cron at 2am,
    # crontab entry: * 2 * * * /usr/local/bin/rsnapshot daily
    
    retain daily 1
    
    ############################################
    #              GLOBAL OPTIONS              #
    # All are optional, with sensible defaults #
    ############################################
    
    # Verbose level, 1 through 5.
    # 1     Quiet           Print fatal errors only
    # 2     Default         Print errors and warnings only
    # 3     Verbose         Show equivalent shell commands being executed
    # 4     Extra Verbose   Show extra verbose information
    # 5     Debug mode      Everything
    #
    verbose         2
    
    # Same as "verbose" above, but controls the amount of data sent to the
    # logfile, if one is being used. The default is 3.
    #
    loglevel        3
    
    # If you enable this, data will be written to the file you specify. The
    # amount of data written is controlled by the "loglevel" parameter.
    #
    logfile        /var/log/rsnapshot
    
    [... bunch of stuff removed to post on stackexchange easier...]
    
    ###############################
    ### BACKUP POINTS / SCRIPTS ###
    ###############################
    
    # LOCALHOST
    # backup  /home/          localhost/
    # backup  /etc/           localhost/
    # backup  /usr/local/     localhost/
    # backup /var/log/rsnapshot              localhost/
    # backup /etc/passwd     localhost/
    # backup /home/foo/My Documents/         localhost/
    # backup /foo/bar/       localhost/      one_fs=1, rsync_short_args=-urltvpog
    # backup_script  /usr/local/bin/backup_pgsql.sh  localhost/postgres/
    # You must set linux_lvm_* parameters below before using lvm snapshots
    # backup lvm://vg0/xen-home/     lvm-vg0/xen-home/
    
    # EXAMPLE.COM
    # backup_exec    /bin/date "+ backup of example.com started at %c"
    # backup [email protected]:/home/ example.com/    +rsync_long_args=--bwlimit=16,exclude=core
    # backup [email protected]:/etc/  example.com/    exclude=mtab,exclude=core
    # backup_exec    ssh [email protected] "mysqldump -A > /var/db/dump/mysql.sql"
    # backup [email protected]:/var/db/dump/  example.com/
    # backup_exec    /bin/date "+ backup of example.com ended at %c"
    
    # CVS.SOURCEFORGE.NET
    # backup_script  /usr/local/bin/backup_rsnapshot_cvsroot.sh   rsnapshot.cvs.sourceforge.net/
    
    # RSYNC.SAMBA.ORG
    # backup rsync://rsync.samba.org/rsyncftp/       rsync.samba.org/rsyncftp/
    
    # what ron uses, very simple, local disks
    # /data is /dev/sdb1 an N tb drive
    # snapshot root folder /bkup is /dev/sdc1 an n tb volume
    # this will copy everything under /data to /bkup/private/mybackup/
    
    backup   /data   mybackup/
    

    如果您设置了一项服务,我认为 SSH 是首选,但它可能是 RSH 或其他服务,它就像通过定制 rsnapshot.conf 文件从源复制到目标一样简单。

    https://wiki.archlinux.org/index.php/Rsnapshot

    https://rsnapshot.org/

    http://www.mikerubel.org/computers/rsync_snapshots/

    rsnapshot 是一个基于 rsync 的文件系统快照实用程序。rsnapshot 可以很容易地通过 ssh 对本地机器和远程机器进行定期快照。该代码尽可能广泛地使用硬链接,以大大减少所需的磁盘空间。 Rsnapshot 完全用 perl 编写,没有模块依赖关系,并且已经在 5.004 到 5.16.3 版本中进行了测试。它应该适用于任何相当现代的 UNIX 兼容操作系统。

    rsnapshot 如果安装在 linux 上会很棒,并且当从源备份到目标时,源基本上是挂载在 linux 上的任何东西。实现挂载在linux上不需要是本地磁盘。

    • 1

相关问题

  • 有没有办法让 ls 只显示某些目录的隐藏文件?

  • 使用键盘快捷键启动/停止 systemd 服务 [关闭]

  • 需要一些系统调用

  • astyle 不会更改源文件格式

  • 通过标签将根文件系统传递给linux内核

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve