Crontab_Module

+------------------------------------------------------------+ | apnscp | +------------------------------------------------------------+ | Copyright (c) Apis Networks | +------------------------------------------------------------+ | Licensed under Artistic License 2.0 | +------------------------------------------------------------+ | Author: Matt Saladna (msaladna@apisnetworks.com) | +------------------------------------------------------------+
extends Module\Skeleton\Standard implements Opcenter\Contracts\Hookable
Methods Summary
public
# list_cronjobs( string $user = NULL )
List cronjobs
public
# list_jobs( string $user = NULL )
List scheduled tasks Invokes crontab -l from the shell and returns the output as an associative
public
# enabled( )
Check if scheduled task service is enabled Returns true if the cron daemon is running within the environment, false if not. Note well that it will return false IF the cron daemon is installed within the account, but is not running on the system.

privilege


public
# user_permitted( string $user = NULL )
public
# filter_by_command( string $command , string $user = NULL )
Find crons that match a command
public
# permitted( )
Service is permitted
public
# crontab_enabled( )

Deprecated


see

enabled()
public
# disable_job( $min , $hour , $dom , $month , $dow , string $cmd , string $user = NULL )
public
# add_raw( $line , $user = NULL )
public
# enable_job( $min , $hour , $dom , $month , $dow , $cmd , $user = NULL )
public
# add_cronjob( $min , $hour , $dom , $month , $dow , $cmd , $user = NULL )
public
# add_job( mixed $min , mixed $hour , mixed $dom , mixed $month , mixed $dow , string $cmd , string $user = NULL )
Schedule a periodic task
public
# exists( $min , $hour , $dom , $month , $dow , $cmd , null $user = NULL )
Cronjob exists
public
# set_mailto( string $address )
Set the recipient for cronjob-generated output
public
# get_mailto( )
Get the recipient e-mail for cronjob-generated output
public
# delete_cronjob( $min , $hour , $dom , $month , $dow , $cmd , $user = NULL )
public
# delete_job( mixed $min , mixed $hour , mixed $dom , mixed $month , mixed $dow , string $cmd , $user = NULL )
Remove a periodic task
public
# reload( )
Reload crond

see

toggle_status()
public
# toggle_status( int $status )
Toggle cronjob status Possible modes: -1: reload 0: kill and remove 1: enable
public
# list_users( )
List all users with an active crontab spool
public
public
public
public
# _edit_user( string $userold , string $usernew , array $oldpwd )
protected
# _deny_user_real( $user )
protected
# _permit_user_real( $user )
public
# restart( )
public
# deny_user( string $user )
Deny a user from using crontab facility
public
# permit_user( string $user )
Permit a user access to crontab
public
# _verify_conf( Opcenter\Service\ConfigurationContext $ctx )
public
public
Methods inherited from Module\Skeleton\Standard
__construct(), setUserParameters(), autoloadModule(), __wakeup(), _invoke(), __debugInfo(), getExportedFunctions(), _reset(), cleanUserParameters(), query()
Constants Summary
public array DEPENDENCY_MAP
# array ( 0 => 'siteinfo', 1 => 'ssh', )
public string CRON_SPOOL
# '/var/spool/cron'
public string CRON_PID
# '/var/run/crond.pid'
Constants inherited from Module\Skeleton\Standard
DEPENDENCY_MAP
Properties Summary
protected $exportedFunctions
# array ( 'permit_user' => 2, 'deny_user' => 2, 'user_permitted' => 3, 'toggle_status' => 2, 'reload' => 2, 'list_users' => 2, '*' => 3, )
Properties inherited from Module\Skeleton\Standard
$exportedFunctions, $username, $password, $domain, $user_id, $group_id, $permission_level, $session_id, $site, $site_id