Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1445
  • Last Modified:

Rsync on Solaris 10

I am using rsync to mirror postgres from one Solaris server to other Solaris server.
The problem is after I run the script the data is not updated only after I restart the data.
I think because the rsync is copy the postmaster.pid too from the first server.
This is my 1ST script:

#!/bin/bash

SOURCEPATH='/cluster'
DESTPATH='/'
DESTHOST='192.168.28.251'
DESTUSER=root
LOGFILE=rsync.log

echo $\n\n >> $LOGFILE
rsync -e ssh -avz --delete-after $SOURCEPATH $DESTUSER@$DESTHOST:$DESTPATH 2>&1 >> $LOGFILE
echo "Completed at: `/bin/date`" >> $LOGFILE

After that I add onethr line to the script : --exclude postmaster.pid
Now i got an error: rsync: link_stat "/SOURCEPATH" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1040) [sender=3.0.5]

What I am doing wrong?
Guys do you know how i can copy with out postmaster.pid
Thanks
0
IonelBoeriu
Asked:
IonelBoeriu
2 Solutions
 
omarfaridCommented:
do you really need to copy every thing? why don't you just copy the data files?
0
 
IonelBoeriuAuthor Commented:
Thanks for your replay

Why you mean data files?
I need to have same date on both server, to be mirroring. Wlill be copied the first time after  that will be copied only the changes
0
 
omarfaridCommented:
Are you running the two database servers on parallel?
what I mean is that other files are static in nature and only the database data files change, and these that you want to sync
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
IonelBoeriuAuthor Commented:
I want to have  2 database servers

Server  A and server B.
I need to server A to send or from server B to pull data. On the final A and B to have the same date and to be syncronized every 5 min, let say.

Thanks for help
0
 
yuzhCommented:
You should use the proper tools the database vendor provides to backup the database .
Please read:
http://www.sanitarium.net/golug/rsync_backups.html 
0
 
TintinCommented:
rsync is the wrong tool for this task.  You should be using Postgres replication.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now