Sun N1 System Manager 1.1 Administration Guide

ProcedureTo Delete a Job

Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. Determine the job you want to delete.


    N1-ok> show job all
    

    All jobs and job IDs appear in the output.

    See show job in Sun N1 System Manager 1.1 Command Line Reference Manual for details.

  3. Delete the desired job.


    N1-ok> delete job job
    

    The job is deleted.

    See delete job in Sun N1 System Manager 1.1 Command Line Reference Manual for details.

  4. Verify that the job was deleted.


    N1-ok> show job all
    

    The deleted job should not appear in the output.

    See show job in Sun N1 System Manager 1.1 Command Line Reference Manual for details.


Example 5–13 Deleting a Job

This example shows how to delete a job.

First, the show job command is used with the all option, which lists all jobs in descending order.


N1-ok> show job all
Job ID          Date                       Type                  Status           Creator
7               2005-02-16T10:51:07-0700   Discovery             Completed        root
6               2005-02-14T14:42:52-0700   Server Reboot         Error            root
5               2005-02-14T14:38:25-0700   Server Power On       Completed        root
4               2005-02-14T14:29:20-0700   Server Power Off      Completed        root
3               2005-02-09T13:01:35-0700   Discovery             Completed        root
2               2005-02-09T12:38:16-0700   Discovery             Completed        root
1               2005-02-09T10:32:40-0700   Discovery             Completed        root

Job ID 6 has an error and can be deleted. The delete job command is now used with the Job ID of the job to be deleted.


N1-ok> delete job 6

The show job command is used again with the all option, which lists all jobs in descending order. The deleted job no longer appears on the list.


N1-ok> show job all
Job ID          Date                       Type                  Status           Creator
7               2005-02-16T10:51:07-0700   Discovery             Completed        root
5               2005-02-14T14:38:25-0700   Server Power On       Completed        root
4               2005-02-14T14:29:20-0700   Server Power Off      Completed        root
3               2005-02-09T13:01:35-0700   Discovery             Completed        root
2               2005-02-09T12:38:16-0700   Discovery             Completed        root
1               2005-02-09T10:32:40-0700   Discovery             Completed        root


Example 5–14 Deleting All Jobs

This example shows how to delete all jobs.

First, the show job command is used with the all option, which lists all jobs in descending order.


N1-ok> show job all
Job ID          Date                       Type                  Status           Creator
7               2005-09-16T10:51:07-0700   Discovery             Completed        root
6               2005-09-14T14:42:52-0700   Server Reboot         Error            root
5               2005-09-14T14:38:25-0700   Server Power On       Completed        root
4               2005-09-14T14:29:20-0700   Server Power Off      Completed        root
3               2005-09-09T13:01:35-0700   Discovery             Running	        root
2               2005-09-09T12:38:16-0700   Discovery             Completed        root
1               2005-09-09T10:32:40-0700   Discovery             Completed        root

The delete job command is now used with the all option, to delete all jobs.


N1-ok> delete job all

Unable to delete job "3"

The show job command is used with the all option, to confirm whether all jobs were successfully deleted.


N1-ok> show job all
Job ID          Date                       Type                  Status           Creator
3               2005-09-09T13:01:35-0700   Discovery             Running	        root

Job ID 3 is still running. This is because jobs that were in a running state when the delete job command was issued must finish running, or must be stopped, before they can be deleted.

To stop the job and then delete it, first the stop job command is used with the ID of the job to be stopped.


N1-ok> stop job 3

Stop Job "3" request received.

The show job command is used to confirm that the job has been stopped.


N1-ok> show job all
Job ID          Date                       Type                  Status           Creator
3               2005-09-09T13:02:35-0700   Discovery             Aborted	        root

The job has been stopped while running and is in the aborted state. The delete job command is now used with the all option, to delete all jobs.


N1-ok> delete job all

The show job command is used to confirm that all jobs have now been deleted.


N1-ok> show job all
Job ID          Date                       Type                  Status           Creator