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.

Hi.

If you ran the job nohup, check the timestamp of the nohup.out file in the directory you started the job.

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.

You can use this:

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..

Post withdrawn. Test is in retrospect and with three processes submitted in this manner it is not possible to determine when each one finished.

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.

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.

Did you read the reply from Scrutinizer? It pretty much explains that.

No need to use nohup.out, instead use a different one. That file timestamp will indicate when the processing got completed.

Hi Folks - Thanks for all your input.My background job already completed yesterday.I want to know at what time completed.

Looking for help to find out that information other than nohup.out file.

Thanks,
Mansoor.

After job is completed and if the file timestamp is not updated, then that timestamp itself can be used.
Is the output file being updated?