-
How to run my script as a background job in UNIX?
I have a script which does nothing but analyze all tables, while another one is to analyze all indexes. On one side, this is a one time process for testing, so I am not going to do this as a cronjob. And on the other side, it could be hours before this script finishes running, so I'd like to run it in the background.
I know it's doable on UNIX, but how can I achieve that? An example will be specially appreciated...
FYI - it's a SUN box. Let me know if you need other info...
Elaine
-
have a script with in it for example
#!/bin/ksh
sqlplus user/pass@instance <
analyze table xxx compute statistics;
analyze table yyy estimate statistics;
exit
EOF
The from the command line
nohup ./script.ksh &
You can then disonnect your session and it will run in the background
Hmm this forum messes up two of these < was supposed be two of them followed by EOF and then the commands
Last edited by marist89; 07-02-2004 at 10:25 AM.
-
I use screen sometimes, been using since University days. Quite useful to run jobs (not background, I run them in foreground then detach the screen). By default you can open up to 10 terminals in same telnet/ssh session then to leave the job running and not get hang up just detach the screen.
Search unix detach screen in google
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|