rsnapshot和rsyncrsync scp 哪个快好

How to use rsync over FTP - Server Fault
to customize your list.
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.
Here's how it works:
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I have the following cmd line which works fine.
rsync -avr -e ssh /home/dir :/home/
But I need to set it up now to rsync to a remote server that only has an FTP server on it.
How do I go about that?
I looked at the rsync help but quickly got lost (I don't do this stuff very often).
You don't. rsync can't do that for you, it is a protocol of its own and doesn't work over FTP.
You might, however, want to try . IIRC it provides rsync-like behaviour over HTTP. I can't comment on whether it works over FTP, you'll have to try it.
1,89041723
5,44821438
Rsync definitely isn't going to work for you for the reasons others have mentioned.
However, lftp and ncftp both have "mirror" modes that will probably meet your needs.
I use this to push stuff from my local directory to a ftp or sftp web host:
lftp -c "set ftp:list-options -a;
open ftp://user:password@;
cd /web/public_
mirror --reverse --delete --use-cache --verbose --allow-chown
--allow-suid --no-umask --parallel=2 --exclude-glob .svn"
As written by
lftp is very good tool.
I suggest you to parametrize the script, and make use of the
exclude-glob
options, that excludes filenames using the glob feature (*,? ..) of your shell:
#!/bin/bash
HOST="your.ftp.host.dom"
USER="username"
PASS="password"
FTPURL="ftp://$USER:$PASS@$HOST"
LCD="/path/of/your/local/dir"
RCD="/path/of/your/remote/dir"
#DELETE="--delete"
lftp -c "set ftp:list-options -a;
open '$FTPURL';
mirror --reverse \
--verbose \
--exclude-glob a-dir-to-exclude/ \
--exclude-glob a-file-to-exclude \
--exclude-glob a-file-group-to-exclude* \
--exclude-glob other-files-to-exclude"
Warning: make sure that the target directory exists, otherwise the cd command will fail, so operation including deleting trees of files
will take place at wrong directory (root)!
I have updated script so that --delete option is disabled by defaut, enable it by uncommenting the DELETE= command.
Depending of what you're actually trying to do, another completely different approach could be use curlftps to mount a ftp folder, and then maybe rsync the two "local" folders.
The installation is different depending on your distro so I can't generalize on that, but you need to installfuse and curlftpfs (prolly Debian already has fuse install by default), then:
sudo apt-get install curlftpfs
Make sure the fuse module is loaded (modprobe fuse)
sudo curlftpfs
/path/to/ftp/folder/ -o user=username:password,allow_other
Note that there's no space after the last comma (it's not a typo!). If you're satisfied with that or don't want to make that every time, you can add it to your fstab (usually in /etc/fstab):
curlftpfs#user:password@ /path/to/ftp/folder/ fuse auto,user,uid=1000,allow_other 0 0
In that case, you have to make sure the fuse module is loaded before.
Be advised though, of two things:
That the developer dropped the project one or two years ago, so I don't know how usable/stable for the time being.
If the password contains a weird character curlftpfs could fail (maybe you can do something with the .netrc).
There is ...
Weex is an utility designed to
automate the task of remotely
maintaining a web page or other FTP
archive. It will synchronize a set of
local files to a remote server by
performing uploads and remote deletes
as required.
rsync does not work over ftp. On the remote side it needs either the rsync daemon or a shell that it can call rsync from. Ftp generally allows you to call a few commands and rsync is not one of them. There are other tools meant for automating ftp tasks like "lftp".
1,40141520
This seems like a good and free fit:
I am using GVFS/FTP.
I mount my remote FTP servers with gigolo.
As they are seen as local directories almost anything working on local files works.
rsync is designed to compute file hashes remotely to compare files without transferring them, but doing that with virtual files transfers the files anyway.
unison and freefilesync normally work well but I met a problem when they want to rename a file thy uploaded, no problem downloading.
This could be a problem with gvfs 1.6.1.
You can use curlftpfs to mount ftp and use rsync after
For what it appears you are trying to do, you could also use wget.
Jonas S's solution can be useful depending on the circumstance, for example if you have a high download speed and slow upload, checking the files on the server might be relatively faster than uploading files unnecessarily.
You probably want to use CurlFTPFS, though:
Although, generally, it is better to use a regular FTP client altogether instead of rsync.
1,89041723
I don't believe you will be able to do this, the server you are trying to Rsync to will only have an FTP server running, it will not understand the commands that Rsync is sending it.
If the reason you want to do this is that you only have access to port 21, but you have control of the server, you can change the port Rsync listens on, on the server, but this is obviously only useful if you don't want to use FTP on that port.
26.9k45895
If you want to automate the task then use lftp as you can create a script as some people have posted above, you can script it all really easily to your liking, if your looking for a one time solution (i.e. you need download an entire website via ftp / move it to another server) use ncftp, its simple, install it if its not already installed:
apt-get install ncftp
yum install ncftp
(sorry non debian/red hat based distros..)
once installed, open ncftp in the terminal then type:
open -u ftpusername
It'll ask you for the password, enter it, and then:
get -R /home/remotewebsite/public_html/ /home/localwebsite/public_html/
It'll do the rest pf the work for you.. good luck
14.8k53475
Using “sitecopy” or “mirror” can save you lots of bandwidth.
They both handle efficient incremental update.
There's also wput:
wput --timestamping --reupload --dont-continue source-files ftp://target.host/dir
The username and password are read from ~/.netrc. Otherwise, if you're not particularly concerned with security, you may supply them as .
and then you can use rsync.
I use the following one.
rsync --delete --times --recursive --perms --owner --group --verbose --progress --stats -e ssh root@192.168.0.100:/folder1/ /folder2/
1,89041723
protected by
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10
on this site.
Would you like to answer one of these
Not the answer you're looking for?
Browse other questions tagged
Server Fault works best with JavaScript enabled您所在的位置: &
Rsync 使用简单介绍之完整性检测
Rsync 使用简单介绍之完整性检测
通常,文件系统的完整性检查是通过操作特定的安全工具来完成的,比如tripwire。这类工具的操作十分彻底,功能非常强大,并提供一系列 灵活的策略,来帮助系统管理员完成文件系统的完整性检测。
对系统管理员来说,可能由于诸多原因而倾向于采用另外的方法来完成完 整性检测。Rsync 使用工具就具备这个功能。它所具有的校验功能能够将原始文件和拷贝后的文件进行对比,可以判断并检查出哪些文件被改变,还 可以判断这些文件的更改操作是否合法,是否具备足够的授权。
对文件系统的完整性检测来说,Rsync 使用所做的第一件事情是为文件系统创建一份 快照。这必须在检查文件系统的完整性之前完成,因为必须有一份完好无缺的拷贝用于检查文件系统是否正确。
完成上述操作之后,在命令行简单地运行一条Rsync 使用复制命令。这里需要注意一下:为了确保所使用Rsync 使用版本不可被入侵者用于和他自己的版 本进行比较,这样文件系统的变化就无法被检测出,需要拷贝一个rsync的二进制文件版本(可能位于/usr/bin/rsync)到一个可写的媒介上,如 光盘上。然后,当使用rsync时,还需要指定rsync二进制文件位于哪个媒介上,而不是指向计算机上的某个版本。例如,如CD安装/mnt/cdrom ,运行如下命令,可从一台计算机上复制文件到另外一台主机上:
rsync -av --rsync-path=/mnt/cdrom/rsync -e ssh host:/ localdir
上述命令表示,从远端主机上复制整个文件系统(期望被检查的文件系统)到运行Rsync 使用所在机器的一个本地文件目录中,一旦拥有了文件系统 的快照,就可以使用如下的命令来检查文件系统的完整性了:
rsync -avn --rsync-path=/mnt/cdrom/rsync -e ssh host:/ localdir
前面提到的-n选项是用来确保没有任何文件被拷贝。而在Rsync 使用工具中则有所不同,它仅报告拷贝之前和拷贝之后的差别所在。如果不希望两者 间出现差别,就应该对它们进行仔细检查,确保没有发生未授权的更改。bin/ls, /bin/bash, 和/bin/sshd等文件若发生改变的话是需要特别 留意一下的,如果它们本来是不应该被更改的但却被改动了,这可能表示系统已遭受了某种安全威胁。但是,如果系统自动更新程序正在运行 ,这些文件被更新进程所改变就是很正常的了。因此,最好让更新程序做好日志记录,将那些更新进程替换过的包或文件都做好标记,再和 rsync的完整性检测报告中列出来的所有被更改过的文件进行对照,这样就可以检测出哪些文件已经被非法更改了。
【编辑推荐】
【责任编辑: TEL:(010)】
关于的更多文章
智能化运维是用机器来代替运维人员,在最少人工干预下,结合运用
Linux界极具活力,面向不同的用户可以使用不同的Linux发行版,比如适合新手和游戏爱好者等。
讲师: 39人学习过讲师: 7人学习过讲师: 55人学习过
OS X Server的Mavericks版本并没有发生这样巨大的变化
近几年,开源业界的创新发展很繁荣,不仅在软件层面,
TFS为淘宝提供海量小文件存储,通常文件大小不超过1M
在本书中,Thomas ERL呈现了第一部端对端的教程,提供了从基层开始的面向服务的建模与设计的逐步指导。通过逐步的、清晰生动的、
51CTO旗下网站您所在的位置: &
管理员宝典:迷死人不偿命的开源工具(5)
管理员宝典:迷死人不偿命的开源工具(5)
布加迪编译
本文为想在工作中领先一步的系统管理员和网络管理员介绍了13款开源管理工具,希望能帮助系统管理员们更快速、更轻松地完成工作任务。
11、Rsnapshot
说到在Linux和*BSD系统上进行备份,我们可是有好多的选择:Bacula、Amanda、Arkeia及更多工具。我的最爱却是Rsnapshot,它基于出色的Rsync文件镜像实用工具。Rsnapshot使用Unix硬链接,为每一个快照有效地保留一个完全备份,却只耗用差异备份的网络带宽和磁盘空间。备份内容则被保存到备份服务器硬盘上的普通文件系统,而不是备份到磁带上,所以根本不需要更换存储介质。由于rsnapshot使用常见的Unix工具,比如Perl、Rsync和硬链接,它可以在几乎任何类似Unix的操作系统上运行,甚至可以在Mac OS X、Solaris和Irix上运行。
12、管理和控制面板ISP Control Panel
ISP Control Panel基于颇有年头的Virtual Hosting Control Panel(虚拟主机控制面板)项目,生来是为了运行主机托管服务。它有多个不同的控制面板,分别适用于ISP服务管理员、服务转售商和终端客户。ISP Control Panel旨在与一系列特定的服务器软件应用程序协同运行,但是它提供了几乎一切齐全即可投入使用的交钥匙系统,立马可以运行一家主机托管公司。
ISP Control Panel提供了你期望从一家主机托管公司获得的所有服务,包括Sender Policy Framework(发送方策略框架)记录、带宽使用跟踪以及具有加入灰名单功能的垃圾邮件过滤等服务。除了FreeBSD外,它还明确支持Debian和红帽Linux,说明文档表明它应该可以在其他任何Linux或*BSD版本上运行。
13、U盘启动制作工具UNetbootin
我还记得头一次想把Linux安装到U盘上时,先后参阅了十来个不同的网站,这些网站给出的一套操作方法各不相同,可是每一次结果都灰心丧气。有了UNetbootin项目,就很容易在U盘上直接安装Live Linux了。你可以使用UNetbootin制作的U盘,启动进入到Linux,或者把Linux作为一个双启动选项安装到Windows PC上。这是从此可以随身携带Linux的一种简易方法。
原文链接:
【编辑推荐】
【责任编辑: TEL:(010)】
内容导航&第 1 页: &第 2 页: &第 3 页: &第 4 页: &第 5 页:
关于&&的更多文章
随着云计算、大数据和互联网的高速发展,快速迭代的产品需求和良
Linux界极具活力,面向不同的用户可以使用不同的Linux发行版,比如适合新手和游戏爱好者等。
讲师: 3人学习过讲师: 9人学习过讲师: 4人学习过
日前,红帽正式发布了企业版 Linux 7 ,满足企业当前
日前,中国政府采购网发布《关于进行信息类协议供货强
Windows Server 2012 R2 自发布后,就有很多朋友已经
当前,开源框架层出不穷,它为用户提供了通用的解决方案,同时也增加了用户的学习难度。开源是一把“双刃剑”,一方面它共享了资
51CTO旗下网站

我要回帖

更多关于 rsnapshot 的文章

 

随机推荐