| Advertise on warmetal.nl! Click for more information about advertising here. |
Did you find this website useful? Did I save you a lot of time? |
|
tar -cvf /scratch/myfile_20030617.tar /scratch/mydir/results/stat/*
tar -xf myfile_20030617.tar
PermitRootLogin yes #AllowGroups ssh-access
and restart the ssh service:
sudo /etc/rc.d/rc2.d/Ssshd stop sudo /etc/rc.d/rc2.d/Ssshd start
bash-3.2# tar clf - /opt/IBM/WebSphere | ssh 10.10.10.100 "tar xf - -C /opt/IBM/WebSphere" root@10.10.10.100's password: tar: file -C: not present in archive bash-3.2#
Tar options explanation:
-l
Writes an error message to standard output for each file with a link count greater than 1 whose
corresponding links were not also archived. For example, if file1 and file2 are hard-linked together and
only file1 is placed on the archive, then the -l flag will issue an error message. Error messages are not
displayed if the -l flag is not specified.
-C Directory
Causes the tar command to perform a chdir subroutine to the directory specified by the Directory variable.
Using the -C flag allows multiple directories not related by a close common parent to be archived, using
short relative path names. For example, to archive files from the /usr/include and /etc directories, you
might use the following command: tar c -C /usr/include File1 File2 -C /etc File3 File4
bash-3.2# du -sm /opt/IBM/WebSphere/
1490.79 /opt/IBM/WebSphere/
bash-3.2# find /opt/IBM/WebSphere/ -type f |wc -l
16247
bash-3.2# find /opt/IBM/WebSphere/ -type d |wc -l
2805
New server:
/opt/IBM>sudo du -sm /opt/IBM/WebSphere/
1490.66 /opt/IBM/WebSphere/
/opt/IBM>sudo find /opt/IBM/WebSphere/ -type f |wc -l
16247
/opt/IBM>sudo find /opt/IBM/WebSphere/ -type d |wc -l
2805
As you can see there is a small difference between the data size. This is not really a problem because the old server is in use, and there could be differences in block size etc. The amount of files is exactle the same so that is more important.
Discussion