Operating System - HP-UX
1837113 Members
2127 Online
110112 Solutions
New Discussion

Re: using rdist to update directories with different names

 
Jim Kern
New Member

using rdist to update directories with different names

Greetings,

This is my first forum question. I want to update files on a different machine with different directory names than the source using rdist. My source is mach1:/nfs/dir1 and I want to update files on mach2:/nfs/dir1_sby

Is this possible? I realize their is an option to append the full path name but this dosen't work in my case. I want to tell it the name of the destination. Hope this makes sense??
First time questioner
3 REPLIES 3
Tim Sanko
Trusted Contributor

Re: using rdist to update directories with different names

We always use a file for the contents, and the destination

we put this in cron rdist -f distfile > /dev/null
this is our distfile
HOSTS = ( root@XXX.XXX.XXX.X )
FILES = ( /d001/TEST/app/group/program/data )
Time=(`/usr/bin/date +%X`)
Month=(`/usr/bin/date +%m`)
Day=(`/usr/bin/date +%d`)
Year=(`/usr/bin/date +%Y`)
Directory = ( /d001/recovery/INST_${Year}${Month}${Day}_${Time}_HOMEDATA )
${FILES} -> ${HOSTS}
install ${Directory};

That allows us to rdist nightly for our own backup to a second server. That we can get an identical structure of our application.

Hope that helps

Tim
Jack C. Mahaffey
Super Advisor

Re: using rdist to update directories with different names

I've built a script that might be more complicated than what you want. It will make a copy of a link, file or directory and prefix the name with .pri. e.g. /etc/jimbob.pri.passwd. It then uses rdist to clone the file to additional servers.

I'll attach the script. It uses a configuration file. Here's some sample entries for the configuration file.


rdist.conf file contents...
=====================================================
# src=Source Host
# Type = Type of rdist
# file
# dir
# link
# Base = Base directory where file or subdirectory is located
# File/Directory = Name of file or directory to be distributed
# owner: owner of file or directory .... Used for mkdirs of directories only
# For information only for files.
# Perm = Permission of of file or directory ... Used after mkdirs of interim directories
# For information only for files.
# Targets = Hostnames of hosts that are to receive copies
#
# Src Type Base File/Directory owner Perm Targets
#file /etc/passwd -
jimbob file /etc passwd root:sys 0444 server1 server2
sneezy file /etc passwd root:sys 0644 server1 server2
jimbob dir /var/sam lp root:sys 0755 server1
jimbob link /etc termcap root:sys 1755 server1
============================================

There might be some additional scripts used by the utility. Let me know if you want more...

Jack


Jack C. Mahaffey
Super Advisor

Re: using rdist to update directories with different names

Here's a copy of the check_rdist.conf.sh script...