Resync data on File system


 
Thread Tools Search this Thread
Operating Systems AIX Resync data on File system
# 1  
Old 04-20-2011
Resync data on File system

Hi All,

I have two mount points have the same data with little changes between them

/appabc1
/appabc2

Both of them have the same data, there is some little changes on the data between them

I want /appabc2 to has the same data of /appabc1 exactly including to those little changes !

How to can I Resync the data between them?


Pls advice in that... Smilie
# 2  
Old 04-20-2011
Well, you can delete everything and copy afresh:
Code:
rm -rf /appabc2/*;cp -rp /appabc1/* /appabc2

or go by modified date, checksum or bit for bit compare of every file. Do you need to trim excess files in /appabc2/ ? New files need to be added, of course. Can there be new dirs? See man cpio pass option with updates only, which does a lot of this. The rsync command seems overkill for local files. Off the cuff = untested, files only, exact compare:
Code:
(
  cd /appabc1
  find . -type f
  cd /appabc2
  find . -type f
 ) | sort -u | while read f
do
 f="${f#./}"
 if [ ! -f "/appacb1/$f" ]
 then
  rm -f "/appabc2/$f"   # prune
  continue
 fi
 if [ -f /appabc2 -a "$(cmp "/appacb1/$f" "/appabc2/$f" 2>&1)" = "" ]
 then
  continue
 fi
 cp -p "/appacb1/$f" "/appabc2/$f"
done

# 3  
Old 04-21-2011
you can use rsync for this purpose

Code:
rsync --verbose --progress --stats --recursive --times --links --update --perms --owner --group /dir1/ /dir2

older Files will not be copied over newer ones, and no files will be deleted ( if you want this, use --delete)
# 4  
Old 04-22-2011
Quote:
Originally Posted by funksen
you can use rsync for this purpose

Code:
rsync --verbose --progress --stats --recursive --times --links --update --perms --owner --group /dir1/ /dir2

older Files will not be copied over newer ones, and no files will be deleted ( if you want this, use --delete)

It's good command , but I want accurate answer about this command
If I have file in the /dir1 called appfile.log has size :20MB
And in /dir2 appfile.log has size :15MB
If i re sync the directories by the below command


PHP Code:
rsync --verbose --progress --stats --recursive --times --links --update --perms --owner --group /dir1/ /dir2 
That mean the appfile.log will be updated and synced in /dir2 and will take the same size ?
# 5  
Old 04-22-2011
yes - rsync works with ctime - when the log on the original was changed later than on the destination, than the smaller log will be replaced.

Regards
zxmaus
# 6  
Old 04-24-2011
it's giving me this error

PHP Code:
kshrsyncnot found 
is it requiring to install rsync-3.0.6-1.aix5.3.ppc.rpm ?

---------- Post updated 04-24-11 at 03:04 AM ---------- Previous update was 04-23-11 at 04:53 AM ----------

Command got hanged in some bad files !

Is there any option to ignore any unreadable files or bad files?!

Pls advice!
# 7  
Old 04-25-2011
try to run fsck, to eliminate those "bad" files, or try to remove them manually

cheers
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

/tmp/man18809436: Invalid file system control data detected

/tmp/man18809436: Invalid file system control data detected Help me what do I do? Если знаете русскии, пишите на нем. (2 Replies)
Discussion started by: islily
2 Replies

2. UNIX for Dummies Questions & Answers

Can I reboot during a metadevice resync?

In my infinite lack of wisdom, I brought a Solaris 10(Sparc, 64 bit ) system down to init 1, detached a metadrive so that I could run format->analyze->refresh on it, and then reinit'd and reattached it . It started syncing the drive as it's a submirror of a mirrored drive, which happens... (8 Replies)
Discussion started by: the.gooch
8 Replies

3. UNIX for Advanced & Expert Users

how to make a full system backup excluding data and restoring it to a new system

Hi, In order to have a sand box machine that I could use to test some system changes before going to production state, I'd like to duplicate a working system to a virtual one. Ideally, I'd like to manage to do it this way : - Make a full system backup excluding the user file system (this... (7 Replies)
Discussion started by: pagaille
7 Replies

4. UNIX for Advanced & Expert Users

File system testing for Data corruption

Hi, could any one tell is there any test-suite or any idea How to do data corruption validation testing, means there is no any data corruption ? Regards Manish (1 Reply)
Discussion started by: manish_tcs_hp
1 Replies

5. Linux

Increasing total data size per file system request for block drivers

Hi All, I am writing a block driver for a 2GB SD card where i get the total amount of data per request as follows: struct request *req; uint card_addr,total_bytes; struct request_queue *rq = BlkDev->queue; req = elv_next_request(rq); .. .. card_addr = req->sector*512;... (1 Reply)
Discussion started by: amio
1 Replies

6. UNIX for Advanced & Expert Users

Data Recovery from file system overwritten with LVM.

Hey peeps, Here is somethin u might find interestin.... Is it possible to recover data from a partition which used to be an ext3 file sytem with some nice forgotten backups, which now is an lvm partion containg root partition of another OS. :) I couldn't create any mess better than this, can... (2 Replies)
Discussion started by: squid04
2 Replies

7. Shell Programming and Scripting

how to verify that copied data to remote system is identical with local data.

I have created simple shell script #!/bin/sh echo `date`; echo "Start .... find . -mtime +95 -print > /tmp/files.txt for file in `cat /tmp/files.txt` do echo "copying file - $file" /usr/local/bin/scp -p -P 2222 $file remote.hostname:/file/path echo "copid file -... (3 Replies)
Discussion started by: ynilesh
3 Replies

8. UNIX for Dummies Questions & Answers

raidctl and resync when reboot

I am using raidctl on a v440 disk and noticed it resyncs after every boot, which takes about 30 minutes because of the size of the partition. I am concerned with what happens during the resync if "writes" happen to the disk before it is complete? Any info would be helpful. Thanks (0 Replies)
Discussion started by: csgonan
0 Replies

9. HP-UX

file system had I/O error(s) on meta-data

I'm having this error when I do full fs cleanup # fsck -F vxfs -o full /dev/vg01/lvol1 vxfs fsck: file system had I/O error(s) on meta-data. log replay in progress vxfs fsck: file system had I/O error(s) on meta-data. vxfs fsck: file system had I/O error(s) on meta-data. pass0 - checking... (2 Replies)
Discussion started by: catwomen
2 Replies
Login or Register to Ask a Question