![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Rsync via cron | vibhor_agarwali | UNIX for Advanced & Expert Users | 5 | 07-03-2007 07:23 AM |
| Scripting stepping stones. | syndex | UNIX for Dummies Questions & Answers | 2 | 07-02-2007 11:53 AM |
| use rsync by cron | Steven.surfboy | UNIX for Dummies Questions & Answers | 0 | 02-20-2006 05:19 PM |
| Cron Script Q | doublek321 | Shell Programming and Scripting | 2 | 07-06-2004 10:35 PM |
| stepping through ascii file | rehoboth | UNIX for Dummies Questions & Answers | 12 | 08-30-2002 01:06 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Rsync script in cron from stepping on itself
I have the following rsync script that I use for syncing MySQL files from one server to another. I run the script at 20 minutes past every second hour in cron. I want to make sure that the script completes in it's entirety before it is set to kick off again. For example, when the script starts at 1:20pm, it should finish before the 3:20pm interation of the script. If the 1:20pm script is still running, I would want the 3:20pm interation of the script to not run and maybe even send me an email. Below is the script I have as it currently runs. Any help, suggestions would be appreciated
![]() # Variables # REMHOST="serverB" ERRFILE="/tmp/rsync_mysql_error.log" MAIL_LIST="System.Administrator@mydomain.com" # Following options equate to: preserve links,recursive,preserve permissions, # preserve times,quiet,and compress OPTS="-lrptqz" #NOTE: You must put a slash (/) at the end of your paths for the dirs to copy correctly! /usr/local/bin/rsync $OPTS /apps/mysql/data/var/ $REMHOST:/apps/mysql/data/var/ > ${ERRFILE} if [ -s ${ERRFILE} ]; then mailx -s "/apps/mysql/mysql_rsync.ksh script encountered an error...Please investigate." ${MAIL_LIST} < ${ERRFILE} fi rm ${ERRFILE} |
|
||||
|
Thanks for the tip in2nix4life...that is exactly what I was looking for. I plan on test driving that today !
As to your question reborg, we are doing the rsync as a "poorman's" failover solution. I asked our DBA about the replication you mentioned and he stated that they had tested it before and had encountered some sort of network related issues, etc. and did not want to use that. Thanks again for all the help and suggestions, this is a wonderful site for learning and sharing technical knowledge ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|