易截截图软件、单文件、免安装、纯绿色、仅160KB

linux下的fastcopy

在拷贝数据的时候,如果遇到一堆小文件,即使总数据量很小,拷贝也会很费时,在win下,有一个软件叫fastcopy,可以实现快速拷贝,据说使用了一种叫内存映射的技术,那么在Linux下有没有呢?
我找了半天,原来LInux下根本不需要单独的软件,用现有的命令组合就OK了!
有高手在两个服务器间传数据,使用命令,实现了快速传送数据。
http://www.4bcj.com/post/2008/01/Fast-File-Copy—Linux!.aspx
All good ideas come out of necessity. We were cloning an instance of
Oracle Financials from one server to another. There are a LOT of files
under < 1k and the copy takes forever. Yesterday the copy was kicked
off using SCP - there was 39GBs to copy over a gigabit switch. This
should have been less than 10 minutes but actually took over 8 hours
because of all the small files. The copy failed and we needed to fix
the problem and copy it a lot faster (30 minutes) today.
After clearing up 10 GBs of log files, we were left with hundreds of
thousands of small files that were going to slow us down. We couldn’t
tarball the file because of a lack of space on the source server. I
started searching around and found this nifty tip that takes our
encryption and streams all the files as one large file:
This requires netcat on both servers.
Destination box: nc -l -p 2342 | tar -C /target/dir -xzf -
Source box: tar -cz /source/dir | nc Target_Box 2342
It’s been about 4 minutes and I’m already 1/3 of the way done!
感谢本校LInux版主ashmer,写了这个shell脚本,可以实现fastcopy, 与诸位共享.
#!/bin/sh
# file: fastcp.sh
source="$1"
target="$2"
if [ "x$1" == "x" ] || [ "x$2" == "x" ] ; then
echo "$0 SOURCE_DIR TARGET_DIR"
exit 1
fi
exec tar -cp "$source" -f - | tar -xpv -C "$target" -f -
#end
PS: 测试了一番,速度竟然由cp的0m21.270s降低至0m6.984s,真是够快的。。。


相关文档:

在linux下如何把一个lvm的文件系统减小

在linux下如何把一个lvm的文件系统/home减到1G。比aix下麻烦,aix下直接把文件系统缩到某个值,对应的lv自动就减少了,不像linux要先缩小文件系统,再缩小lv。
suse1:~ # df -m
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/mapper/system-root
5040 299 ......

嵌入式linux系统与应用

Emebedded System and Application(Linux)
 
Goal
--
掌握嵌入式系统开发的流程,系统移植的方法,编写Bootloader
            (Be familiar with the process of ES Developing
, System Migration
amd Bootloader Programming
)
 Requriem ......

linux引导过程内幕


Linux 引导过程内幕
 
 
引导 Linux® 系统的过程包括很多阶段。不管您是引导一个标准的 x86 桌面系统,还是引导一台嵌入式的 PowerPC® 机器,很多流程都惊人地相似。本文将探索 Linux 的引导过程,从最初的引导到启动第一个用户空间应用程序。在本文介绍的过程中,您将学习到各种与引导有关的主题, ......

Linux C notes (BOOK UNIX)

Chapter 1: Thread
① thread functions
1. pthread_self();
2. thread existing
    you can get the value of rval_ptr just by  pthread_join(pthread_t tht, void ** rval_ptr)
    cancel a thread as the thread exits with PTHREAD_CANCELED in pthread_exit, this functio ......

Linux系统性能指标介绍

http://andrew913.javaeye.com/blog/431259
理解Linux调优参数
在我们介绍Linux系统的各种调优参数和性能监测工具之前,需要先讨论一些关于性能调优的参数。因为Linux是一个开源操作系统,所以又大量可用的性能监测工具。对这些工具的选择取决于你的个人喜好和对数据细节的要求。所有的性能监测工具都是按照同样的规则来 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号