Operating System - HP-UX
1826123 Members
5350 Online
109690 Solutions
New Discussion

rdist command (same date in both servers)

 
SOLVED
Go to solution
Manuales
Super Advisor

rdist command (same date in both servers)

Hi my friends !!!!

How can i make to have same date file from remote server to local server when is executed rdist command?

Thanks, Manuales.
4 REPLIES 4
Ivan Ferreira
Honored Contributor
Solution

Re: rdist command (same date in both servers)

I'm not sure of what you need but you can use the touch command to modify the date of files after you transfer it. You could use NTP to synchronize the date/time of the servers.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Manuales
Super Advisor

Re: rdist command (same date in both servers)

well, i'll explain it to you ...
i have a server called "a" and other server called "b", in server "a" i have a file called "patito" this file in server "b" has a different date then i executed rdist command to file "patito"
"patito" is same release in server "a" and server "b" but the date of this file in server "a" and "b" is different, i has seen that if the file in server "b" not exists then its replicate with same date but if this file exists in server "b" then it has other date ....

how can i have same date altought the file exists?

Thanks, Manuales
Bob Ingersoll
Valued Contributor

Re: rdist command (same date in both servers)

By default rdist preserves the mtime of the source file. From the rdist man page:

"It preserves the owner, group, mode, and modification time of files if possible and can update programs that are executing."

It sounds like rdist is not copying the file to the target for some reason.
Geoff Wild
Honored Contributor

Re: rdist command (same date in both servers)

How are you using rdist? can you post your distfile?

Example, one of mine is:

# cat distfile
BWPDR = ( svr1102 )

#
# File systems to be copied over to the DR host.
# Don't use -R in install - so as not to remove files on destination host
BWPADM = /home/bwpadm

bwpadm: ( ${BWPADM} ) -> ( ${BWPDR} )
install -w ;



And I call it from cron via a script like this:

# cat /app/admin/drp/update-binaries.sh
#! /bin/sh

# Keep the DRP copy of the bwpadm up-to-date.
# Currently the files are in:
#
# /home/bwpadm/DR
#
# See the rdist(1M) distfile for a list of exclusions.

DRPDIR=/app/admin/drp
DRPHOST=svr1102

HOST=`/usr/bin/uname -n`
mount | grep /home > /dev/null 2>&1
if [ $? -eq 0 ]
then
/usr/sbin/vgexport -p -s -v -m /home/bwpadm/DR/vg10.map /dev/vg10
( su - bwpadm -c "rdist -f $DRPDIR/distfile bwpadm"; ) 2>&1 |\
tee $DRPDIR/drp.log 2>&1 |\
mailx -s "bwpadm DRP rdist output" me@mydomain.com
fi


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.