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.
jsilva
November 14, 2003, 12:28pm
2
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...
kduffin
November 15, 2003, 2:51pm
3
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.
kduffin
November 17, 2003, 5:06pm
5
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
kduffin
November 18, 2003, 6:56am
6
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.