• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1441
  • 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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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

Featured Post

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.

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