salt.modules.schedule

Module for managing the Salt schedule on a minion

2014.7.0 新版功能.

salt.modules.schedule.add(name, **kwargs)

Add a job to the schedule

命令行接口CLI 范例:

salt '*' schedule.add job1 function='test.ping' seconds=3600
# If function have some arguments, use job_args
salt '*' schedule.add job2 function='cmd.run' job_args="['date >> /tmp/date.log']" seconds=60
salt.modules.schedule.build_schedule_item(name, **kwargs)

Build a schedule job

命令行接口CLI 范例:

salt '*' schedule.build_schedule_item job1 function='test.ping' seconds=3600
salt.modules.schedule.copy(name, target, **kwargs)

Copy scheduled job to another minion or minions.

命令行接口CLI 范例:

salt '*' schedule.copy jobname target
salt.modules.schedule.delete(name, **kwargs)

Delete a job from the minion's schedule

命令行接口CLI 范例:

salt '*' schedule.delete job1
salt.modules.schedule.disable(**kwargs)

Disable all scheduled jobs on the minion

命令行接口CLI 范例:

salt '*' schedule.disable
salt.modules.schedule.disable_job(name, **kwargs)

Disable a job in the minion's schedule

命令行接口CLI 范例:

salt '*' schedule.disable_job job1
salt.modules.schedule.enable(**kwargs)

Enable all scheduled jobs on the minion

命令行接口CLI 范例:

salt '*' schedule.enable
salt.modules.schedule.enable_job(name, **kwargs)

Enable a job in the minion's schedule

命令行接口CLI 范例:

salt '*' schedule.enable_job job1
salt.modules.schedule.is_enabled(name)

List a Job only if its enabled

2015.5.3 新版功能.

命令行接口CLI 范例:

salt '*' schedule.is_enabled name=job_name
salt.modules.schedule.list(show_all=False, show_disabled=True, where=None, return_yaml=True)

List the jobs currently scheduled on the minion

命令行接口CLI 范例:

salt '*' schedule.list

# Show all jobs including hidden internal jobs
salt '*' schedule.list show_all=True

# Hide disabled jobs from list of jobs
salt '*' schedule.list show_disabled=False
salt.modules.schedule.modify(name, **kwargs)

Modify an existing job in the schedule

命令行接口CLI 范例:

salt '*' schedule.modify job1 function='test.ping' seconds=3600
salt.modules.schedule.move(name, target, **kwargs)

Move scheduled job to another minion or minions.

命令行接口CLI 范例:

salt '*' schedule.move jobname target
salt.modules.schedule.purge(**kwargs)

Purge all the jobs currently scheduled on the minion

命令行接口CLI 范例:

salt '*' schedule.purge
salt.modules.schedule.reload()

Reload saved scheduled jobs on the minion

命令行接口CLI 范例:

salt '*' schedule.reload
salt.modules.schedule.run_job(name, force=False)

Run a scheduled job on the minion immediately

命令行接口CLI 范例:

salt '*' schedule.run_job job1

salt '*' schedule.run_job job1 force=True
Force the job to run even if it is disabled.
salt.modules.schedule.save(**kwargs)

Save all scheduled jobs on the minion

命令行接口CLI 范例:

salt '*' schedule.save