Background job when completed


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Background job when completed
# 1  
Old 11-02-2009
Background job when completed

Hello - I submitted one background job last night and it completed today morning.I want to know exact time the job completed.

I submitted backgroung job like this

nohup cp -Rp /opt/apps/prod/proddb/proddata . &

I want to know when above job completed on UNIX server.Above command submitted on following server.

SunOS proddb 5.10 Generic_141414-09 sun4u sparc SUNW,Sun-Fire-880

Thanks in advance.

Mansoor.
# 2  
Old 11-02-2009
Hi.

If you ran the job nohup, check the timestamp of the nohup.out file in the directory you started the job.
# 3  
Old 11-02-2009
Scott - Thanks for your reply.There are three background jobs submitted from same directory.How can I determine which background job updated this nohup.out file?

Is there any command or series of commands to correlate background job with timestamp like syslog or etc...?

Thanks,
Mansoor.
# 4  
Old 11-02-2009
You can use this:
Code:
nohup cp -Rp /opt/apps/prod/proddb/proddata . >filename.out &

To give each job its own output file. nohup.out is not being used then..
# 5  
Old 11-02-2009
Post withdrawn. Test is in retrospect and with three processes submitted in this manner it is not possible to determine when each one finished.

Last edited by methyl; 11-02-2009 at 10:28 PM..
# 6  
Old 11-03-2009
Quote:
Originally Posted by Scrutinizer
You can use this:
Code:
nohup cp -Rp /opt/apps/prod/proddb/proddata . >filename.out &

To give each job its own output file. nohup.out is not being used then..
Just adding to it,
if the file is immediately modified by another process, then timestamp can't be modified.

Instead, along with nohup process write a sequent process that just creates a hidden file to know the time stamp later. I know this is hacky and dirty way but just a quick and easy way to do that.
# 7  
Old 11-05-2009
Hi Folks - Thanks for all your responses.This is very good information.

But in my case one background job is already completed.I want to know when that job completed.As I mentioned the nohup.out file time stamp is modified by other jobs.

Is there any command or steps to find out when that background job is compelted.

Thanks,
Mansoor.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find the shellscript which is running In background is completed or not?

HI All, I need the answer of below question? 1) how to find the shellscript which is running In background is completed or not ? ex: I know the shellscript name abc.sh which is running in background through cronjob. I want to know this is job is still running or stopped, how to... (3 Replies)
Discussion started by: pspriyanka
3 Replies

2. Shell Programming and Scripting

Background job issue

How to bring a backgroud job say sample_script.sh to foreground (4 Replies)
Discussion started by: rafa_fed2
4 Replies

3. Shell Programming and Scripting

System terminating diff command before job completed

I'm running diff at the command prompt against two very large text files (>1GB) and system kills the process and replys back "Terminated" after 15 seconds. I believe a system parameter needs to be adjusted but can't figure it out. I'm running Red Hat 4.1.2-46, 2.6.18-028stab089.1 Thanks... (4 Replies)
Discussion started by: azpetef
4 Replies

4. Shell Programming and Scripting

Background Job

Hello Everyody, Having a doubt. sort file1 & when we sent a job to the background it returns Job Number PID again if we want to ... (1 Reply)
Discussion started by: knroy10
1 Replies

5. Shell Programming and Scripting

Send an email once a job is completed

Hi, The HPCs I used earlier used PBS (Portable Batch System) to schedule when I was running various jobs and it had an option to send me an email once a job is completed. I'm wondering whether this is possible for any other process (without the use of PBS). For example, I'm running some codes... (2 Replies)
Discussion started by: lost.identity
2 Replies

6. Shell Programming and Scripting

Script to Start a Job after finding the Old job completed

Hi Experts, I need a script advice to schedule 12 jobs ( SAS Codes execute back ground ). Algorithem: 1. Script checks first job. 2. Finds first job is done; invoke second job. 3. finds second job is done; invoke third job. .. Request you to please assist. (3 Replies)
Discussion started by: Jerald Nathan
3 Replies

7. Solaris

killing a unix job after the job process gets completed

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. Thanks... (7 Replies)
Discussion started by: dtazv
7 Replies

8. UNIX for Dummies Questions & Answers

background job

on gnome i open a terminal and run wget http://soommmething & in the background. because wget shows me downloading progress percentage and download speed continuously, I exit the gnome-terminal after a while i want to see the download percentage but dont know how. my ps -u myname shows that... (3 Replies)
Discussion started by: babayeve
3 Replies

9. UNIX for Dummies Questions & Answers

Background job

Hiya, Recently I've run a few scripts in the foreground, but have realised later they should of been better nohup'd and placed in the background. I understand how to change a foreground job into a background one, but how would put the job into the nohup state? Thanks (1 Reply)
Discussion started by: rdbooth
1 Replies

10. UNIX for Dummies Questions & Answers

background job

I try to run a script as background job. script: #!/usr/bin/csh /usr/bin/date +20%y-%m-%d > ~/datsql.txt If I start it I got this output: tac> ./datermitteln& 293 + Stopped (SIGTTOU) ./datermitteln& I insert the following line inside my script, but without any... (3 Replies)
Discussion started by: joerg
3 Replies
Login or Register to Ask a Question