Skip to content

Commit 260c303

Browse files
committed
Added documentation for CRON
1 parent fed4d60 commit 260c303

File tree

10 files changed

+69
-19
lines changed

10 files changed

+69
-19
lines changed

bin/v_add_cron_job

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
2-
# info: adding cron job
2+
# info: add cron job
3+
# arguments: user min hour day month wday command [job]
4+
#
5+
# The function adds a job to cron daemon. When executing commands, any output
6+
# is mailed to user's email if parameter REPORTS is set to 'yes'.
7+
38

49
#----------------------------------------------------------#
510
# Variable&Function #

bin/v_change_cron_job

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
2-
# info: changing cron job
2+
# info: change cron job
3+
# arguments: user job min hour day month wday command
4+
#
5+
# The function is used for changing existing job. It fully replace job
6+
# parameters with new one but with same id.
7+
38

49
#----------------------------------------------------------#
510
# Variable&Function #

bin/v_delete_cron_job

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
2-
# info: deleting sys cron
2+
# info: delete cron job
3+
# arguments: user job
4+
#
5+
# The function deletes cron job.
6+
37

48
#----------------------------------------------------------#
59
# Variable&Function #

bin/v_list_cron_jobs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
2-
# info: listing user cron
2+
# info: list user cron jobs
3+
# arguments: user [format]
4+
#
5+
# The function for obtaining the list of all users cron jobs.
6+
37

48
#----------------------------------------------------------#
59
# Variable&Function #

bin/v_rebuild_cron_jobs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
2-
# info: rebuild cron job
2+
# info: rebuild cron jobs
3+
# arguments: user
4+
#
5+
# The function rebuilds system cron config file for specified user.
6+
37

48
#----------------------------------------------------------#
59
# Variable&Function #

bin/v_restart_cron

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
#!/bin/bash
2-
# Internal vesta function
3-
# cron system restart
2+
# info: restart cron service
3+
# arguments: none
4+
#
5+
# The function tells crond service to reread its configuration files.
6+
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
411

512
# Importing variables
613
source $VESTA/conf/vars.conf
714
source $V_CONF/vesta.conf
815

9-
crond() {
10-
/etc/init.d/crond 'reload' >/dev/null 2>&1
11-
if [ $? -ne 0 ]; then
12-
#$V_FUNC/report_issue 'sys' 'cron'
13-
echo "$E_RESTART_FAILED $V_EVENT"
14-
fi
15-
}
16+
17+
#----------------------------------------------------------#
18+
# Action #
19+
#----------------------------------------------------------#
1620

1721
# Parsing config / or just source config
1822
if [ "$CRON_SYSTEM" = 'crond' ]; then
19-
crond
23+
/etc/init.d/crond 'reload' >/dev/null 2>&1
24+
if [ $? -ne 0 ]; then
25+
echo "$E_PARSING $V_EVENT"
26+
exit $E_PARSING
27+
fi
2028
fi
2129

22-
# Logging
30+
31+
#----------------------------------------------------------#
32+
# Vesta #
33+
#----------------------------------------------------------#
34+
2335
exit

bin/v_suspend_cron_job

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
2-
# info: Suspending sys cron
2+
# info: suspend cron job
3+
# arguments: user job
4+
#
5+
# The function suspends a certain job of the cron scheduler.
6+
37

48
#----------------------------------------------------------#
59
# Variable&Function #

bin/v_suspend_cron_jobs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22
# info: Suspending sys cron jobs
3+
# arguments: user
4+
#
5+
# The function suspends all user cron jobs.
6+
37

48
#----------------------------------------------------------#
59
# Variable&Function #

bin/v_unsuspend_cron_job

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
2-
# info: Unuspending sys cron
2+
# info: unuspend cron job
3+
# arguments: user job
4+
#
5+
# The function unsuspen certain cron job.
6+
37

48
#----------------------------------------------------------#
59
# Variable&Function #

bin/v_unsuspend_cron_jobs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
2-
# info: Unuspending sys cron
2+
# info: unuspend sys cron
3+
# arguments: user
4+
#
5+
# The function unsuspends all suspended cron jobs.
6+
37

48
#----------------------------------------------------------#
59
# Variable&Function #

0 commit comments

Comments
 (0)