Query on running script with nohup


 
Thread Tools Search this Thread
Operating Systems AIX Query on running script with nohup
# 1  
Old 07-23-2010
Query on running script with nohup

Hi,

I'm trying to run database restore script with the nohup command as it will run for long hours since if I run it normally, the putty session will become inactive and the restore gets terminated. The command I use is
nohup db2 -tvf FBR_NODE0000.scr -z FBR_NODE0000.log &
But the problem is the restore script gives a confirmation dialog as shown below
---------------
The Roll-forward recovery logs associated with the target database will be
deleted.
Do you want to continue ? (y/n)
---------------
So the nohup hangs for input here. Any suggestion on how I can execute this.

Regards,
Karthik
# 2  
Old 07-23-2010
I don't have experience with db2, but I suppose that something like this may work:
Code:
nohup echo y | db2 -tvf FBR_NODE0000.scr -z FBR_NODE0000.log &

# 3  
Old 07-23-2010
Untested. Could try piping the output from the unix "yes" command.

Code:
#scriptname
yes|db2 -tvf FBR_NODE0000.scr -z FBR_NODE0000.log

nohup scriptname &

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Keep a script on remote machine running (nohup?)

Hi, I'm using expect to ssh into remote machine (i know its not the best practice), and run script "script.sh". This "script.sh" checks whether an other process (some another script) is running and if not, it runs it as some other user. #!/bin/bash /usr/bin/expect << EOD set... (5 Replies)
Discussion started by: oseri
5 Replies

2. Shell Programming and Scripting

Regarding a query on making changes to a running script

Hello All, Greetings !! I have a query here to all is as follows: Question: Let's say we are running a script in a UNIX box and we have opened an another session and then made changes in script of some statements NOT to be print some values(just an example) so when I am monitoring the... (5 Replies)
Discussion started by: RavinderSingh13
5 Replies

3. UNIX for Dummies Questions & Answers

Extract only the data from ksh script running netezza query

Hi I searched this forum before posting the question, but couldnt find it, the issue i'm facing is, i'm trying to select a column from a netezza table from a korn shell script, but the query runs var=$(nzodbcsql -q "select MAX(millcount) from table1";) echo $var it returns the value like... (10 Replies)
Discussion started by: maximus_jack
10 Replies

4. UNIX for Dummies Questions & Answers

Error running a script in nohup mode

Hi, running this script in normal mode, no error occours #!/usr/bin/ksh VALUE=0 SUBJECT='sub' ADDRESSES="aaa@gmail.com" BODY='body' while true do COUNT=$(tail -2500 /log/file.log | grep -i "error" | wc -l) if ; then echo "$BODY" | mailx -s "$SUBJECT" "$ADDRESSES"... (3 Replies)
Discussion started by: nash83
3 Replies

5. UNIX for Dummies Questions & Answers

How to restrict the execution of same script if it is running already in nohup?

Hi, How can i restrict the execution of same script if it is running already in nohup Thanks (1 Reply)
Discussion started by: ranabhavish
1 Replies

6. Shell Programming and Scripting

Error in running DB query by script

Hi I was trying to fetch data from database. But the number of rows exported were huge so i got the error. Experts please advice. Thanks a lot for your supprt. #: ./script.sh ./script.sh: xmalloc: subst.c:3076: cannot allocate 1401346369 bytes (0 bytes allocated) (2 Replies)
Discussion started by: brij123
2 Replies

7. Shell Programming and Scripting

Running sed from a script query

Hello! I'm trying to run this code to print the body of an html document (all text in between <body> and </body>) from a script but am unsure how to call it from the command line interface. /<body>/,/<\/body>/ 1s/.*<body>// $s/<\/body>.*//p I have tried to call it using this: sed... (6 Replies)
Discussion started by: bgnersoon2be#1
6 Replies

8. Shell Programming and Scripting

Error while running script using nohup

Hi, I am running the below script. When i run the script normally it executes fine but when i run the same script using nohup it throws an error as getStatus.sh: syntax error at line 3: `(' unexpected . Can you let me know why it is so? while do . $(dirname $0)/include.sh cd... (2 Replies)
Discussion started by: vignesh53
2 Replies

9. Shell Programming and Scripting

Running script from script query

Hi I have a question Suppose i have three scripts & i have created a top level script to run these. eg. leaf1.csh leaf2.csh leaf3.csh top.csh Now in top.csh i have written #!/bin/csh leaf1.csh leaf2.csh leaf3.csh Now my question is when i run this top level script when it... (1 Reply)
Discussion started by: sarbjit
1 Replies

10. Shell Programming and Scripting

error ORA-06512 while running query in script

1 #!/bin/ksh 2 ################################################################ 3 # Written by Johnson 12/03/2008 4 # Version 1.0 5 # This script executes some SQL to provide Spike Check Report to TNS team. 6 ... (3 Replies)
Discussion started by: shivanete
3 Replies
Login or Register to Ask a Question