rdist -- but not linked files

How do I rdist a directory from one server to another, excluding soft and hard links?

current rdist syntax:

1 2 * * * cd /apps/oasis/prdsch/log; rdist -c j1*.log oasis@oastdby:/apps/schiller/oasis/prdsch/log

31 2 * * * cd /apps/oasis/prdsch/log; rdist -c oasis_bin_trans*.log oasis@oastdby:/apps/schiller/oasis/prdsch/log

Currently all files ending in .log copied using rdist. I have a number of soft links in the same directory ending in .log and wish to exclude them.

Thanks.

Hi,

There's no argument to exclude links from being "rdisted". You can, however, create a list of links that you don't want to copy and define them on the distfile... Maybe some script using ls-ld...

You could also utilize the find command, ie:

1 2 * * * find /apps/oasis/prdsch/log -name j1*.log -exec rdist {} oasis@oastdby:/apps/schiller/oasis/prdsch/log

find's default behavior is not to follow symbolic links. You have to specify -follow to have it do so.

Cheers,

Keith

Here's what I setup before leaving work Friday:

j1="`find /apps/oasis/prdben/log -name "j1*log" -ctime -30`"
for var in $j1 ; do
rdist -c $var oasis@oastdby:
done

It still copies the links...Why?

Thanks.

Remember that you can take the antethisis of options in find using !

Change your variable to:

j1="`find /apps/oasis/prdben/log ! -type l -name "j1*log" -ctime -30`"

Cheers,
Keith

The modified script is working for me; transfering files without including soft or hard links. Are you using it successfully?

Cheers,

Keith

I just checked and it worked perfectly. Many thanks for your expertise!

This is a great forum.