Solaris数据转移最佳方案。不改变原始时间

一般来说,数据转移都用什么MV阿,CP阿之类的,再聪明点的就用tar 阿,GZIP阿,不过还是太麻烦。而且目录还原很是麻烦!!!
遇到什么不允许改变创建时间的时候,更是不知所措

经过gg,发现可以使用#RCP来实现。

在单位的机器上搞了下:

---------------------------------------------------------------------------------------------
SunOS Wednesday 5.10 Generic_127127-11 sun4v sparc SUNW,SPARC-Enterprise-T2000

ebina@Wednesday # man rcp
Reformatting page.  Please Wait... done

User Commands                                              rcp(1)

NAME
     rcp - remote file copy

SYNOPSIS
     rcp [-p]  [-a]  [-x]  [-PN  |  -PO]   [-k  realm]  filename1
     filename2

     rcp [-pr] [-a] [-x] [-PN  |  -PO]   [-k  realm]  filename...
     directory

DESCRIPTION
     The rcp command copies files between machines. Each filename
     or  directory  argument  is either a remote file name of the
     form:

     hostname:path

     or a local file name (containing no : (colon) characters, or
     / (backslash) before any : (colon) characters).

     The hostname can be an IPv4  or  IPv6  address  string.  See
     inet(7P) and inet6(7P). Since IPv6 addresses already contain
     colons, the hostname should be enclosed in a pair of  square
     brackets  when an IPv6 address is used. Otherwise, the first
     occurrence of a colon can be interpreted  as  the  separator
     between hostname and path. For example,

     [1080::8:800:200C:417A]:tmp/file

     If a filename is not a full path  name,  it  is  interpreted
     relative  to  your  home  directory on hostname. A path on a
     remote host may be quoted using ", ",  or  ',  so  that  the
     metacharacters  are interpreted remotely. Please notice that
     the kerberized versions of rcp are not IPv6-enabled.

     rcp does not prompt for passwords. It either  uses  Kerberos
     authentication which is enabled through command-line options
     or your current local user name must exist on  hostname  and
     allow remote command execution by rsh(1).

     The rcp session can be kerberized using any of the following
     Kerberos  specific  options  :  -a,  -PN  or -PO, -x, and -k
     realm. Some of these options (-x and -PN or -PO) can also be

。。。 。。。省略若干。看主要的参数:

 

     -p              Attempts to give each copy the same  modifi-
                     cation  times, access times, modes, and ACLs
                     if applicable as the original file.

     -r              Copies each subtree rooted at  filename;  in
                     this  case  the destination must be a direc-
                     tory.

------------------------------------------------------------------------

-p 就是拷贝每个文件的修改时间,模式等原始参数

-r 拷贝每个子目录,整个文件结构

最后介绍下RCP的使用方法:

 #rcp -r -p DEST_IP:/DESTDIR /LOCALDIR

DEST_IP就是你要拷贝的数据源,注意有冒号,后面跟目录, 再来一个空格,然后接你要最终拷贝到的地方。

在这之前你还需要下“/”下创建个内容为 “+”的“.rhosts”文件,来建立服务器认证权限。当然你也可以具体去设置什么IP阿,主机名阿什么的。不过你用完了再删,

无所谓了。就#vi .rhosts....后面自己去搞了。

 

 

 

 

转载于:https://www.cnblogs.com/maqintoshi/archive/2008/10/28/1321415.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值