Stopping scheduled clone jobs using JOBQUERY and JOBKILL

With the release of NetWorker 7.6 SP1 we see the introduction of scheduled clones. These are predefined policies that allow NetWorker to initiate clone jobs at particular times with a wide variety of saveset selection criteria available to choose from.

However, there is still a problem in NetWorker where some systems, it is not possible to stop a scheduled clone job from within NMC once it is actively running. This is fruststrating to say the least, especially when you get into a situation where all the tape drives are busy and you need to perform a restore, or it's stopping you from doing scheduled maintenance on the NetWorker server.

All is not lost, we can stop a scheduled clone job using the command line. If there's only one clone job running, you can probably use the operating system's process kill options. But if you have multiple jobs running and you only want to stop one, you may need to approach it more carefully. To do this, you'll need to use two newer commands in NetWorker — jobquery and jobkill.

First, identify the cloning session that you wish to stop:

# jobquery
jobquery> show name; job id; job state
jobquery> print type: clone job; job state: SESSION ACTIVE
                      job id: 32768;
                   job state: SESSION ACTIVE;
                        name: clone.friday_night clones;

Each scheduled clone job that is running will be named clone.<cloning policy name>. Use that cloning policy name to identify the job ID number for the job.

Once the job identifier has been extracted, run the command:

jobkill -j jobID

In the above case, the command would be:

# jobkill -j 32768

NetWorker will report, Terminating job 32768, and you should be able to verify in NMC within 30 seconds that the job has terminated.