LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   backup script causing data to be lost on main server- RHEL (https://www.linuxquestions.org/questions/linux-newbie-8/backup-script-causing-data-to-be-lost-on-main-server-rhel-789197/)

fedora_user 02-15-2010 05:49 AM

backup script causing data to be lost on main server- RHEL
 
hi
this is a strange one for me. i setup the following script ro run each night (12am) as a cron on the main server:

if mount | grep -q '/home';
then
rsync -ranv --delete /home/ 138.73.56.12:/home;
else
exit 1;
fi
##

the main server is running on a dell poweredge 2600.
The script rsyncs to a virtualised duplicate running on a hp dl380.

when i set this script up and begn running data started going missing from the main server. if new files had been created the files by staff they would go missing, if data was added to existing files prior to activating the script the new changes made to that file would be lost.i just cant understand why this happened. as soon as i turned the script off after a few days it was all back to normal but the data that had gone missing had gone missing.
i just wanted to know if this could be a disk read/write issue, was the script running too soon not allowing data to be written before it can be backed up? could it bee memory? i just dont know.
another developed occured after a few days of all this happening, which was one of our hard disk from the main server started mis behaving and flashing amber (attention). could this have caused the problem?
i guess what i want to know is what was the likely casuse. i hope with users experienced in such a scenario can help :)

kbp 02-15-2010 08:11 PM

The 'n' argument to rsync will result in a dry-run, no changes will be made. Are you sure there is data being written to the remote host ?

If files are disappearing/not being written then chances are it's the failing disk.

cheers

fedora_user 02-16-2010 05:45 AM

kbp
thanks for your post. checking on the backup server data was being copied accross. what i dont understand is that data was being written to the main server and people were opening their files again after a few days to continue work only to find the data had gone missing? could that be because when data is worked on from the main server, the changes to the files are only in memory until some point later in the day? the main server config is poweredge 2600, raid 5 hardware across 4 disks.
i just cant imagine the rsync cause this. but on the other hand when i stopped rsync script everything was back to normal...

kbp 02-16-2010 06:46 AM

Can you confirm that /home is actually mounted from local disk ?

fedora_user 02-16-2010 07:40 AM

hi kbp
for sure /home is mounted. i think it was probably the faulty hard disk you mentioned..


All times are GMT -5. The time now is 12:01 PM.