Solved

Rsync on Solaris 10

Posted on 2009-03-31
6
1,290 Views
Last Modified: 2013-12-21
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
Comment
Question by:IonelBoeriu
6 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 24033034
do you really need to copy every thing? why don't you just copy the data files?
0
 

Author Comment

by:IonelBoeriu
ID: 24033100
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
 
LVL 40

Expert Comment

by:omarfarid
ID: 24033155
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:IonelBoeriu
ID: 24033224
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
 
LVL 38

Accepted Solution

by:
yuzh earned 250 total points
ID: 24035475
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
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 250 total points
ID: 24036342
rsync is the wrong tool for this task.  You should be using Postgres replication.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now