Nohup immediately stops.


 
Thread Tools Search this Thread
Operating Systems Solaris Nohup immediately stops.
# 1  
Old 05-22-2013
Nohup immediately stops.

I try and start a short script nohup the nohup immediately stops.
Here's the code
Code:
#!/bin/sh
rm backup.out
for i in `cat /home/xxxxx/Allservers.txt`

do
echo "Logging onto $i"
ssh -qt $i '/usr/local/bin/sudo "/src/bkupsa"'
done >>backup.out

Any ideas?
# 2  
Old 05-22-2013
First of all don't use this approach: for i in `cat /home/xxxxx/Allservers.txt`. It is Useless Use of backticks.

Use while loop instead. Also use -n option with ssh to prevent it reading from stdin:
Code:
#!/bin/sh

rm backup.out
while read host
do
        echo "Logging onto $host"
        ssh -qtn $host '/usr/local/bin/sudo "/src/bkupsa"'
done < /home/xxxxx/Allservers.txt > backup.out

# 3  
Old 05-22-2013
When I run the script I receive the following error:

Pseudo-terminal will not be allocated because stdin is not a terminal.

Any more ideas?

Thanks!

---------- Post updated at 03:25 PM ---------- Previous update was at 03:21 PM ----------

When I tun the script nohup, it's great. No errors.

Works like a champ.
# 4  
Old 05-22-2013
Remove -t option:
Code:
ssh -qn $host '/usr/local/bin/sudo "/src/bkupsa"'

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Saving nohup output to a file other than nohup.out

Shell : bash OS : Oracle Linux 6.4 I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts. For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
Discussion started by: kraljic
7 Replies

2. Shell Programming and Scripting

'script' command exits immediately

I'm trying to capture the output of some commands with the 'script' utility. Normally, I would type 'script /path/to/output/file', then enter commands, then hit ctrl+D to end the 'script' capture. I'm having trouble with it on a server. Upon starting 'script', it exits immediately before I type... (6 Replies)
Discussion started by: jalburger
6 Replies

3. Shell Programming and Scripting

please tell immediately

what is the script to take files from ftp to unix server and unzipped the files (1 Reply)
Discussion started by: sunilamarnadh
1 Replies

4. Programming

Experts !!! I Need HELP immediately..!

HI, I am getting the error : ErrCode:-2 Message:Application Initialisation function Err Params:Could not Load SO/DLL Nothing specific is coming, just the above error. Can anyone tell me how to debug this error. Thanks. (3 Replies)
Discussion started by: amol_helwatkar
3 Replies

5. Linux

please help immediately

how can i check if the size of my file is greater than 5MB and if it is so then how can I direct my data to another new file. the data will be in the form of SQL query (4 Replies)
Discussion started by: infyanurag
4 Replies

6. Shell Programming and Scripting

Please respond immediately

Hi ..please tell me how to modinfy an existing file in a directory, i need commands like to open edit and save n execute the file in BASH. please respond immediately (3 Replies)
Discussion started by: deepti.1104
3 Replies

7. UNIX for Dummies Questions & Answers

I need help immediately. Please help me

Hi Everyone, I am writing a script, in that i want to find out whether my disk space usage capacity extends more than 98%. If my disk space capacity extends more than 98% i want to print that the space capacity is running out of space otherwise i want to print only the capacity of the space... (4 Replies)
Discussion started by: Sheethal
4 Replies

8. AIX

UIDs being overwritten immediately

We have a problem where we delete a user and their associated UID gets dumped back in the UID pool. The if we immediately create a another (new) user, AIX reuses the last UID, the one that was just released. This is causing a problem when reports are being generated because the new users name is... (2 Replies)
Discussion started by: xsys2000
2 Replies

9. Shell Programming and Scripting

Need a Shell Program immediately

Hi Friends, I need a simple shell script(Linux..bash shell) for the below description. Can anyone help me please. I need it very urgently. That is why i cannot write it myself. Objective Create shell scripts using: · Simple interactive menus · Variables, functions Description Create a... (4 Replies)
Discussion started by: praji
4 Replies
Login or Register to Ask a Question