running command in background


 
Thread Tools Search this Thread
Operating Systems Solaris running command in background
# 1  
Old 08-03-2012
running command in background

hi all

i am running following command

Code:
ufsdump  0ubf  512 /dev/rmt/0cbn /database/backup2/rman_backup/level1 >> /database/backup2/backup_tape/level1_rman_03aug12 2>&1;

i want to run it in background how can i do it
in this i am generating logs for backup.

the problem occurs when i am taking OS backup the server is in single user mode so i can not able to get another session so i can not see the logs.
so i want to run it in background.
please help.

Last edited by DukeNuke2; 08-03-2012 at 08:07 AM..
# 2  
Old 08-03-2012
If your shell allows for job control: Replace the semicolon at the end of your command by "&"

I dimly recall once using a tool called screen that allows several sessions under one login session.

Last edited by RudiC; 08-03-2012 at 07:29 AM.. Reason: another approach...
# 3  
Old 08-03-2012
on Solaris, you can background a command with the & at the end, but you should also nohup it like this:

Code:
nohup <<command>> &

Screen is a very nice utility too, very helpful.
# 4  
Old 08-04-2012
I'd recommend against mucking about with screen while in single user mode. Keep it as simple as you possibly can when on the terminal.
edit: Also, don't worry about nohup when doing your task, you won't be sending any HUP signals or breaking a TTY stream while sitting on the console (see above: simple = good)

Last edited by Smiling Dragon; 08-04-2012 at 01:47 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Htop - How to detect exact command running at background

Hello, I am running a python file from terminal and I wish to see which code is running at background. When I use htop, I see just a few commands, unable to see entire command. htop > report nano report Output: ^ Following parts of ffmpeg line is not shown by htop. Just showing... (7 Replies)
Discussion started by: baris35
7 Replies

2. Shell Programming and Scripting

Running script in background

Hi, I wrote a KSH script and running it on HP-UX machine I am running one script in background. My script is at location $HOME/myScript/test/background_sh When I view my script in background with psu commend > psu | grep background_sh I see following output UID PID PPID C ... (1 Reply)
Discussion started by: vaibhav
1 Replies

3. UNIX for Dummies Questions & Answers

Sudo ssh with command running in background

I am trying to run a command. This is one of my attempts: for i in fileservera; do ssh -t $i 'sudo ls /';doneThis works, and I see the directories. However, what I want to do now is start a process on the remote server such as /usr/bin/connectproc -standalonesudo /usr/bin/connectproc... (1 Reply)
Discussion started by: newbie2010
1 Replies

4. Shell Programming and Scripting

command to see process running at background

Hi , I want to see all the background process that are running in unix box machine...please guide me is there any specific command for that..since I am executing some scripts at background..!!:confused: (1 Reply)
Discussion started by: nks342
1 Replies

5. Shell Programming and Scripting

Running in background

Hello, I was trying to make some processes to run at background and went to a problem. First I tried just to loop in one line something like this: for i in {1..10}; do echo 'hello world' &; done; but it pops a syntax error, so I tried several ways to fix it but wasn't able to understand... (2 Replies)
Discussion started by: Rash
2 Replies

6. Shell Programming and Scripting

running the script in background

I have a script called startWebLogic.sh which I was running in the background but the problem is which I used the command :- ps -elf | grep "startWebLogic.sh" | grep -v grep to find the process id but I was unable to find the process id for this script and when I checked from the front end the... (3 Replies)
Discussion started by: maitree
3 Replies

7. UNIX for Dummies Questions & Answers

kill a command I am running / then put it to background

I have a command running in the foreground (and so my term window is locked up) and I want to kill it, then resume it in the background and go home. It is creating a zip file, and the file will be written to the current directory - no std in / std out issues. How do I do this? Kill it with a... (3 Replies)
Discussion started by: hindesite
3 Replies

8. Solaris

About running processes in background

Hi, I need to establish a procedure that will start an application in background each time my remote Solaris server is (re)started. This would be a kind of daemon. I am no sysadmin expert, so I am looking for pointers. How should I proceed? What are the main steps? Thanks, JVerstry (9 Replies)
Discussion started by: JVerstry
9 Replies

9. UNIX for Dummies Questions & Answers

Running the Script in Background.

Gurus, Pls. help on this to run the script in background. I have a script to run the informatica workflows using PMCMD in script. Say the script name is test.sh & Parameters to the script is Y Y Y Y The no of parameters to the bove script is 4. all are going to be a flags. Each flag will... (2 Replies)
Discussion started by: prabhutkl
2 Replies

10. Shell Programming and Scripting

running in background

i have a script called server.sh. how to run this script in backgroung using nohup command (5 Replies)
Discussion started by: ali560045
5 Replies
Login or Register to Ask a Question