Tar and un-tar issue

In AIX 5.3,

I have these directories:

/lms
/lms/w_standard
/lms/d_admin
/lms/b_common
/lms/b_prodbus
/lms/d_prod
/lms/d_prod/ccldir
/lms/d_prod/ccluserdir
/lms/d_prod/config
/lms/d_prod/data
/lms/d_prod/log
/lms/d_prod/ocd
/lms/d_prod/print
/lms/d_prod/temp
/lms/reg
/lms/w_standard/prod_wh

and I want to make a tarball for only these directories, and move the tarball to another AIX node (AIX 6.1) and un-tar so that I can keep the exact directories and contents on the AIX 6.1 node.

Can you please advise on
1) how to make a tarball for only these specific directories and their sub-directories
2) how to un-tar the tarball so that it doesn't create duplicate directories on the target AIX node?

Appreciate it!

I am a little confused by your showing /lms and then some subdirectories originated in /lms. So, you do not want ALL files in /lms directory? If this is the case then I'd do following:

 cd /lms
 tar cvf your_tarball_file_name \
 w_standard \
d_admin \
b_common \
b_prodbus \
d_prod \
d_prod/ccldir \
d_prod/ccluserdir \
d_prod/config \
d_prod/data \
d_prod/log \
d_prod/ocd \
d_prod/print \
d_prod/temp \
reg \
w_standard/prod_wh
 

This command will place all files from subdirectories specified into a tarball. Copy it to the target machine and extract from it as follows:

 cd /your/target/folder
 tar xvf your_tarball_file_name
 

migurus,

Some of /lms' sub-directories are mounted. That is why you are seeing the mounted /lms/* directories.
I DO want all of the directories, their sub-directories, and all contents. I want to make everything into a tarball, and un-tar onto the target node.

Here, what would be the /your/target/folder? The target AIX node has the same directory structure as the source. So, /your/target/folder would be /lms, or just / ?

Please advise.

Yes, cd /lms on your target system

You can use absolute PATH with Unix tar:

tar cvf lms.tar \
/lms/w_standard \
/lms/d_admin \
/lms/b_common \
/lms/b_prodbus \
/lms/d_prod \
/lms/d_prod/ccldir \
/lms/d_prod/ccluserdir \
/lms/d_prod/config \
/lms/d_prod/data \
/lms/d_prod/log \
/lms/d_prod/ocd \
/lms/d_prod/print \
/lms/d_prod/temp \
/lms/reg \
/lms/w_standard/prod_wh

and on the destination node

tar xvf lms.tar

If you have ssh you can do it in one stroke:

tar cvf - \
/lms/w_standard \
/lms/d_admin \
/lms/b_common \
/lms/b_prodbus \
/lms/d_prod \
/lms/d_prod/ccldir \
/lms/d_prod/ccluserdir \
/lms/d_prod/config \
/lms/d_prod/data \
/lms/d_prod/log \
/lms/d_prod/ocd \
/lms/d_prod/print \
/lms/d_prod/temp \
/lms/reg \
/lms/w_standard/prod_wh | ssh destination_node tar xf -

---------- Post updated at 02:14 PM ---------- Previous update was at 01:55 PM ----------

Another method

find /lms -xdev -print

If this shows the correct files, transfer them with cpio like this

find /lms -xdev -print | cpio -o | ssh destination_node cpio -idm

I have ssh set up between the two nodes, so I prefer this method.
I don't see the parent directory /lms on the command line.
What do we do with /lms ? Please advise.

It will create the needed /lms but maybe not with the original permissions (because they are not present in the tar file).
The cpio method will transfer the correct permissions for /lms.

With any of these, is it possible to skip the files with the same filesize in the destination node? It will be great to save time for the copy as to there are a number of files, which takes a long time if I copy over all files over again.

I like to skip the same files, exiting in the destination node. In that case, I can just copy over new/updated files, which will be a huge time saver.

Please advise.