Viii. Job Management

Source: Internet
Author: User

View Usage:

[Email protected] ~]# Salt-run-d|grep jobs
' Jobs.active: ' #查看当前执行的job
Return a actively running jobs from a job ID centric
Salt-run jobs.active
' Jobs.list_job: '
Salt-run Jobs.list_job 20130916125524463507
' Jobs.list_jobs: '
List all detectable jobs and associated functions
Salt-run Jobs.list_jobs
' Jobs.lookup_jid: '
Salt-run Jobs.lookup_jid 20130916125524463507
Salt-run Jobs.lookup_jid 20130916125524463507 outputter=highstate
' Jobs.print_job: '
Salt-run Jobs.print_job 20130916125524463507

[[email protected] ~]# Salt ' super66 ' cmd.run ' sleep 100;ls '
^cexiting on Ctrl-c
This job ' s Jid is:
20160917113447042036
The minions is not a finished running and any remaining minions would return upon completion. "To" the "return" to "the" later run:
Salt-run Jobs.lookup_jid 20160917113447042036

To view the currently running job:

[Email protected] ~]# Salt-run jobs.active
20160917113447042036:
----------
Arguments:
-Sleep 100;ls
Function:
Cmd.run
Returned:
Running:
|_
----------
SUPER66:
6115
Target:
Super66
Target-type:
Glob
User:
Root

To view the results of job execution:

[Email protected] ~]# Salt-run Jobs.lookup_jid 20160917113447042036
SUPER66:
Desktop
Documents
Downloads
Music
Pictures
Public
Templates
Videos
Anaconda-ks.cfg
Install.log
Install.log.syslog

To view the job execution details process:

[Email protected] ~]# Salt-run jobs.list_job 20160917113447042036
Arguments:
-Sleep 100;ls
Function:
Cmd.run
Minions:
-Super66

..........

Manage Jobs through Modules:

To see how to use Help:

[email protected] ~]# Salt \* sys.doc saltutil |grep Job
' Saltutil.find_cached_job: ' #查询job cache info
Return the data for a specific cached job ID
Salt ' * ' Saltutil.find_cached_job <job id>
' Saltutil.find_job: ' #查看job信息
Return the data for a specific job ID
Salt ' * ' Saltutil.find_job <job id>
' Saltutil.kill_job: ' #kill Job (sigterm 9)
Sends a Kill signal (SIGKILL 9) to the named salt job ' s process
Salt ' * ' Saltutil.kill_job <job id>
Salt ' * ' Saltutil.runner jobs.list_jobs
' Saltutil.signal_job: '
Sends a signal to the named salt job ' s process
Salt ' * ' saltutil.signal_job <job id> 15
' Saltutil.term_job: ' #删除job (sigterm 15)
Sends a termination signal (SIGTERM) to the named salt job ' s process
Salt ' * ' Saltutil.term_job <job id>

Eight, job management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.