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....后面自己去搞了。