mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 05:44:07 -07:00
Added documentation for CRON
This commit is contained in:
parent
fed4d60cfe
commit
260c303d84
10 changed files with 69 additions and 19 deletions
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: adding cron job
|
# info: add cron job
|
||||||
|
# arguments: user min hour day month wday command [job]
|
||||||
|
#
|
||||||
|
# The function adds a job to cron daemon. When executing commands, any output
|
||||||
|
# is mailed to user's email if parameter REPORTS is set to 'yes'.
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: changing cron job
|
# info: change cron job
|
||||||
|
# arguments: user job min hour day month wday command
|
||||||
|
#
|
||||||
|
# The function is used for changing existing job. It fully replace job
|
||||||
|
# parameters with new one but with same id.
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: deleting sys cron
|
# info: delete cron job
|
||||||
|
# arguments: user job
|
||||||
|
#
|
||||||
|
# The function deletes cron job.
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: listing user cron
|
# info: list user cron jobs
|
||||||
|
# arguments: user [format]
|
||||||
|
#
|
||||||
|
# The function for obtaining the list of all users cron jobs.
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: rebuild cron job
|
# info: rebuild cron jobs
|
||||||
|
# arguments: user
|
||||||
|
#
|
||||||
|
# The function rebuilds system cron config file for specified user.
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
|
|
|
@ -1,23 +1,35 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Internal vesta function
|
# info: restart cron service
|
||||||
# cron system restart
|
# arguments: none
|
||||||
|
#
|
||||||
|
# The function tells crond service to reread its configuration files.
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Variable&Function #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Importing variables
|
# Importing variables
|
||||||
source $VESTA/conf/vars.conf
|
source $VESTA/conf/vars.conf
|
||||||
source $V_CONF/vesta.conf
|
source $V_CONF/vesta.conf
|
||||||
|
|
||||||
crond() {
|
|
||||||
/etc/init.d/crond 'reload' >/dev/null 2>&1
|
#----------------------------------------------------------#
|
||||||
if [ $? -ne 0 ]; then
|
# Action #
|
||||||
#$V_FUNC/report_issue 'sys' 'cron'
|
#----------------------------------------------------------#
|
||||||
echo "$E_RESTART_FAILED $V_EVENT"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Parsing config / or just source config
|
# Parsing config / or just source config
|
||||||
if [ "$CRON_SYSTEM" = 'crond' ]; then
|
if [ "$CRON_SYSTEM" = 'crond' ]; then
|
||||||
crond
|
/etc/init.d/crond 'reload' >/dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "$E_PARSING $V_EVENT"
|
||||||
|
exit $E_PARSING
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Logging
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Vesta #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: Suspending sys cron
|
# info: suspend cron job
|
||||||
|
# arguments: user job
|
||||||
|
#
|
||||||
|
# The function suspends a certain job of the cron scheduler.
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: Suspending sys cron jobs
|
# info: Suspending sys cron jobs
|
||||||
|
# arguments: user
|
||||||
|
#
|
||||||
|
# The function suspends all user cron jobs.
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: Unuspending sys cron
|
# info: unuspend cron job
|
||||||
|
# arguments: user job
|
||||||
|
#
|
||||||
|
# The function unsuspen certain cron job.
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: Unuspending sys cron
|
# info: unuspend sys cron
|
||||||
|
# arguments: user
|
||||||
|
#
|
||||||
|
# The function unsuspends all suspended cron jobs.
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue