首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将远程Linux服务器备份到windows

将远程Linux服务器备份到windows
EN

Unix & Linux用户
提问于 2019-02-05 16:04:06
回答 2查看 2.4K关注 0票数 1

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

我正在寻找一种类似于此的方法,但在windows:来自远程服务器的备份

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

EN

回答 2

Unix & Linux用户

回答已采纳

发布于 2019-02-05 19:06:47

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

我主要担心的是文件系统问题。Rsync尝试同步元数据,而不是在单独的位置捕获元数据(就像tarzip那样)。这意味着在元数据与目标文件系统不兼容的地方,您将遇到问题。

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

如果您试图在没有任何奇怪名称的情况下通过web文件夹进行同步,并且所有权/权限不是什么大问题,那么它应该运行得很好。如果您试图同步linux根文件系统,并希望保留所有设备和权限,我认为在windows上进行rsync可能更有问题。

另一种方法是在windows服务器内运行linux。然后,您可以根据需要配置VM。如果它所做的仅仅是一些非工作时间的文件传输,并且您有大量的RAM,那么它根本不应该对windows服务器的性能产生太大的影响。

票数 2
EN

Unix & Linux用户

发布于 2019-02-05 21:39:02

rsnapshot.conf

代码语言:javascript
复制
#################################################
# 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 root@example.com:/home/ example.com/    +rsync_long_args=--bwlimit=16,exclude=core
# backup root@example.com:/etc/  example.com/    exclude=mtab,exclude=core
# backup_exec    ssh root@example.com "mysqldump -A > /var/db/dump/mysql.sql"
# backup root@example.com:/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_快照/

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

如果安装在linux上,并且在从源代码备份到目标(源代码基本上是安装在linux上的任何东西)时,r快照都是很棒的。实现在linux上挂载不需要是本地磁盘。

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/498836

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档