![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Monitoring SCP for completion | thumper | UNIX for Dummies Questions & Answers | 2 | 03-29-2008 03:38 AM |
| Tab completion in csh | James McMurray | Shell Programming and Scripting | 3 | 12-12-2007 10:31 AM |
| Tab completion gubbins | GNUless | UNIX for Dummies Questions & Answers | 2 | 08-15-2006 11:40 AM |
| Tab Completion on Solaris 10 | annointed3 | UNIX for Dummies Questions & Answers | 2 | 01-04-2006 10:25 AM |
| file name completion | rein | Shell Programming and Scripting | 1 | 10-10-2005 08:57 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Job Completion Information?
Hi,
I am trying to get some information on the jobs that are running. I have used the "ps" command, to get information such as 'cpu usage', 'username', 'pid', etc., I've also used the "bjobs" command to get information such as 'submit time' and 'start time'. The only thing I need now is to get the 'completion time'. After several tries, all that I can see is the 'submit time', and 'start time'. How do I get the 'completion time' or 'end time' of a job? Is there any command that can be used to get the job completion time or atleast the time taken for execution? Thank you very much for your time and efforts. |
|
||||
|
Quote:
You can always use $ echo "Script $0 started @ `date` >> $yourlogfile" (note that you can modify the date format, to learn more about this try `man date`) You can grep top 900 or ps -ef for your process (pid of current process is always $$). Note if you grep with $$ you will get first child process(es) out aswell. You can also grep for $0 (program itself), but if running multible times this is not certain. for exit status you will use $? after a commandline (for instance "ls -l *.txt 2&1>/dev/null";echo $?) --- this means if files was found exit status of ls is 0 (0 is always the good exitstatus), if its greater than 0 it means either ls was flagged bad or it returned no rows. You will then use $? in an if like "pexitcode=$?;if [ $pexitcode -gt 0 ]; then echo "$0 went bad, exiting with status $pexitcode";fi (its always a good idea to set $? of a commandline right after, so that you will be able to use it later on You can always exit your program, with an exitcode/status, note that no code after an exit will be run. You can choose your own exit codes as you wish, dont know if unix core has a limit, but somewhat all you need is less than a hundred... hope this helps Last edited by congo; 08-03-2007 at 04:33 AM.. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|