KSH - Issue with endless loop.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting KSH - Issue with endless loop.
# 8  
Old 06-22-2011
What I meant by conditional copy is to just copy files that don't already exist in the destination. I'll check out resync and see how that works.

The script was created long before Oracle RMAN was used but the idea was we wanted to leave x number of days online and available for recovery and send a copy of them to a NAS drive for offsite backup.

Thanks so far for all the replies. This is a great site.
# 9  
Old 06-22-2011
Quote:
Originally Posted by Sylvan303
The script was created long before Oracle RMAN was used but the idea was we wanted to leave x number of days online and available for recovery and send a copy of them to a NAS drive for offsite backup.
OK, now it's easy: just backup your database and archive logs to disk with rman using a certain retention (the restore and recovery will be fast from the disk).
Then backup the backupsets to tape (you can do it with rman or whatever system utility you prefer).
# 10  
Old 06-22-2011
if you have still problem ,maybe try to add a control before while.
Code:
if [ -s $archive_list ] ; then ... cat $archive_list | while read aname
...............
........

regards
ygemici
# 11  
Old 06-22-2011
Quote:
Originally Posted by Sylvan303
What I meant by conditional copy is to just copy files that don't already exist in the destination. I'll check out resync and see how that works.
That is indeed what rsync is for.
# 12  
Old 06-22-2011
Ok. I am on IBM AIX and it doesn't have the rsync utility. I will look into the (GNU cp).

As far as using RMAN, that might be the way to go. Just dump this old way of saving off he archive logs and use RMAN exclusively.
# 13  
Old 06-22-2011
rsync is also a GNU utility.
# 14  
Old 06-22-2011
That would be great if I can get the rsync loaded on IBM. I will check on it.
Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Help with accidental endless loop

I was practicing writing simple loops as I am a new bash user and I created this script, which turned out to be an endless loop where the echo output does not stop and I do not see where my mistake is. #!/bin/bash echo 'enter a number from 1 to 100' read number while do ... (2 Replies)
Discussion started by: goldenlinx
2 Replies

2. Shell Programming and Scripting

Script runs in endless loop

Hi, AM very new to shell scripting and try to run a simple do while loop statement, but it ends up running endlessly. please can anyone assist, dunno what am doing wrong, any useful suggestions will be welcomed. #!/bin/ksh ### To check a running process instance #################... (5 Replies)
Discussion started by: bayoo
5 Replies

3. Shell Programming and Scripting

[Solved] Endless while loop when compare files

Hi All, I've written a script to read 2 files and compare the contents using while loop but somehow when $line is not found in test2, the script will continue looping. Below is my code, pls advise what could went wrong TIA Nick for line in test1.txt | while read line do grep -i... (4 Replies)
Discussion started by: Nick1971
4 Replies

4. Shell Programming and Scripting

Preventing an endless loop with recursive grep

When finding a string in files within a directory, one can use this: grep -r "searchstring" dir/subdir/ > listofoccurrences.txt For brevity sake one can enter the intended directory and use this: grep -r "searchstring" . > listofoccurrences.txt which as I found out leads to an endless loop,... (2 Replies)
Discussion started by: figaro
2 Replies

5. Shell Programming and Scripting

Help with While loop in KSH

Hi, I want to write a while loop like this can any one say me whats wrong with my loop USAGE="Usage: Mail.ksh" integer i=3 while ((1<i<=3)) do . . . . (( CMD_JUL = LSD_JUL - i )) CUR_MAINT_DATE=$(julian2date ${CMD_JUL}) . . . i=i-1 done (1 Reply)
Discussion started by: bhagya2340
1 Replies

6. Shell Programming and Scripting

[PHP] endless loop mimics a cron. Make sure only one instance is running

Hi, PHP user here. I'm using an endless loop to perform to mimic a cron. The script does something every 20 minutes. It sleep()s in the meantime. I have various checks that ensure that only instance can run, including a "gentleman agreement" locked file. However, I'd like to make sure... (2 Replies)
Discussion started by: jjshell
2 Replies

7. Shell Programming and Scripting

calculating endless columns

I have about 5000 columns of data that i need to convert all of it into pecentages. for shorter colums i have been using this code: {print $1/($1+$2)*100,$2/($1+$2),$3/($3+$4)*100 .....} but this is a teadious process... is there anyway to do it without having to write all of them out? sample... (20 Replies)
Discussion started by: chronicx
20 Replies

8. Shell Programming and Scripting

For loop in ksh..Please help..

Hi ALL, I need to take some command line arguments for my script and then want to run a function for each argument.I thought of using for loop as below, but its not working , can some one please help... #!/bin/ksh lpar1=$1 lpar2=$2 lpar3=$3 lpar4=$4 lpar5=$5 echo "$lpar1" >>lpar.txt echo... (4 Replies)
Discussion started by: prashant43
4 Replies

9. Shell Programming and Scripting

Endless Loop

Hi, I'm pretty new to UNIX shell scripting and need some help. We have an Informatica interface that dumps any files that have errors into a directory. I need to check that directory periodically for any of up to 9 files that might be in it and run a specific process for each file found. The... (3 Replies)
Discussion started by: JeffR
3 Replies

10. Shell Programming and Scripting

Endless loop - Fork function failed?

I need a quick script that will serve as a sort of "real time monitor" for watching some log files. I am using Bourne shell in HP-UX 10.20. I have basically created a script that never ends, unless of course I manually terminate it. Here's the script (it's called qhistory): clear echo "REAL... (3 Replies)
Discussion started by: cdunavent
3 Replies
Login or Register to Ask a Question