Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have started a background job. Is there a way to know how it is progressing, and whether it has stopped?

My command line is like:

java weka.classifiers.trees.J48  -t data.arff  J48-data.model >&  log
share|improve this question
add comment

3 Answers 3

up vote 2 down vote accepted

For java processes, use jps command. This would give more information pertaining to the java environment of the java process.

share|improve this answer
add comment

You could simply tail the log, which would be useful if the job produces regular output

Or a ps -ef will let you know current status of your job (ie whether it is running, finished or in some other state)

share|improve this answer
add comment

In addition to Nikhil's Java-specific suggestion of jps and Rory's suggestion to look at the log:

You can look for the process in the output of htop (or top, which has a crappier UI). You'll see how much CPU time it's currently using.

You can trace the process with strace (on Linux, or some equivalent such as trace or dtrace or ktrace on other unices): strace -p1234 where 1234 is the process ID. This will tell you if the process is doing something (which may or may not be something useful) or if it's blocked waiting for input somewhere.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.