Welcome to iraf.net Tuesday, April 30 2024 @ 11:41 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 run IRAF job in background
   
ping
 02/09/2007 06:18PM (Read 8730 times)  
+++--
Chatty

Status: offline


Registered: 04/13/2006
Posts: 45
hello,Is it possible to run IRAF job in background so even the window where the job is submitted is closed, the job is still running?I want to log into another machine to start an IRAF job. But I need log out of that machine once the job is started.Thanks,Ping

 
Profile Email
 Quote
fitz
 02/09/2007 06:18PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
So long as all of the output is redirected this shouldn't be a problem normally. I'm assuming you're talking here about things like procedure scripts. One possible problem might be with a script that uses foreign commands: These are executed in a spawned shell and if your .cshrc file does something which expects a terminal (e.g. an 'stty' or 'tset' command belonging in our .login file) the script may die. Graphics from tasks can be redirected to a file using the ">G" convention or with a task 'device' parameter to save the metacode if needed, graphics input would require a cursor command file.-Mike

 
Profile Email
 Quote
ping
 02/09/2007 06:18PM  
+++--
Chatty

Status: offline


Registered: 04/13/2006
Posts: 45
Hi Mike,Thanks for your reply.I want to run allstar in background. How should I do it?
Should I start iraf first, or run it on command line using
cl < scriptThanks,Ping

 
Profile Email
 Quote
fitz
 02/09/2007 06:18PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Be sure to turn off the 'verify' package param in DAOPHOT to suppress the prompts, after that something like[code:1:b5057059dd] da> allstar dev$ypix default default default default default >& out.txt & [/code:1:b5057059dd]should run it in the background and you can log out. If you have a number of images, the a file of those commands (without the final '&') can be run as "cl < cmds >& cmd.out &" and should process each command in turn.-Mike

 
Profile Email
 Quote
ping
 02/09/2007 06:18PM  
+++--
Chatty

Status: offline


Registered: 04/13/2006
Posts: 45
Hi Mike,I just tried.I can run it as
cl < script >& outbut that doesn't free the window.If I run ascl < script >& out &it gives errorcl> BKG ERROR: new CL installed; logout and try againI log out and made new iraf. The error is the same.Thanks,Ping

 
Profile Email
 Quote
fitz
 02/09/2007 06:18PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Try making it a simple procedure script,i.e.[code:1:5b95fae0e1]
procedure doit()
begin
.....your list of commands
end
[/code:1:5b95fae0e1]declared as a task with "cl> task $doit = /path/doit.cl", the run as "cl> doit >& out &" That was why I asked about procedure scripts before, I remember something about history scripts and background tasks but don't remember the details.-Mike

 
Profile Email
 Quote
ping
 02/09/2007 06:18PM  
+++--
Chatty

Status: offline


Registered: 04/13/2006
Posts: 45
Hi Mike,I wrote a very simple script:procedure doit()
begin
print 111111
end
I can run it as:doit >& outBut once I add the final &, It dies with the error:cl> BKG ERROR: new CL installed; logout and try againPing

 
Profile Email
 Quote
fitz
 02/09/2007 06:18PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Using just the script you sent:[code:1:7b6b7b9834]
apphot> cd /tmp
apphot> vi doit.cl
....and I cut-n-paste your code....
apphot> task $doit = doit.cl
apphot> doit
111111
apphot> doit >& out
apphot> doit >& out &
[1]
apphot>
[1] done 0.0 0:00 0%
[/code:1:7b6b7b9834]Check your 'uparm' directory, I'm wondering whether there's an old background file in there (i.e. beginning w/ 'bkg', just delete it).-Mike

 
Profile Email
 Quote
ping
 02/09/2007 06:18PM  
+++--
Chatty

Status: offline


Registered: 04/13/2006
Posts: 45
Hi Mike,I did exactly as you said. But as soon as I add the final &, it dies.
I deleted the bkg files in uparms. But it didn't help.Ping

 
Profile Email
 Quote
ping
 02/09/2007 06:18PM  
+++--
Chatty

Status: offline


Registered: 04/13/2006
Posts: 45
Hi Mike,I found the reason.I started IRAF with "ncl". When I start is with cl, it works.Thanks!Ping

 
Profile Email
 Quote
   
Content generated in: 0.29 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login