Browse Source

Added documentation for CRON

Serghey Rodin 14 years ago
parent
commit
260c303d84

+ 6 - 1
bin/v_add_cron_job

@@ -1,5 +1,10 @@
 #!/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                     #

+ 6 - 1
bin/v_change_cron_job

@@ -1,5 +1,10 @@
 #!/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                     #

+ 5 - 1
bin/v_delete_cron_job

@@ -1,5 +1,9 @@
 #!/bin/bash
-# info: deleting sys cron
+# info: delete cron job
+# arguments: user job
+#
+# The function deletes cron job.
+
 
 #----------------------------------------------------------#
 #                    Variable&Function                     #

+ 5 - 1
bin/v_list_cron_jobs

@@ -1,5 +1,9 @@
 #!/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                     #

+ 5 - 1
bin/v_rebuild_cron_jobs

@@ -1,5 +1,9 @@
 #!/bin/bash
-# info: rebuild cron job
+# info: rebuild cron jobs
+# arguments: user
+#
+# The function rebuilds system cron config file for specified user.
+
 
 #----------------------------------------------------------#
 #                    Variable&Function                     #

+ 23 - 11
bin/v_restart_cron

@@ -1,23 +1,35 @@
 #!/bin/bash
-# Internal vesta function
-# cron system restart
+# info: restart cron service
+# arguments: none
+#
+# The function tells crond service to reread its configuration files.
+
+
+#----------------------------------------------------------#
+#                    Variable&Function                     #
+#----------------------------------------------------------#
 
 # Importing variables
 source $VESTA/conf/vars.conf
 source $V_CONF/vesta.conf
 
-crond() {
-    /etc/init.d/crond 'reload' >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-        #$V_FUNC/report_issue 'sys' 'cron'
-        echo "$E_RESTART_FAILED $V_EVENT"
-    fi
-}
+
+#----------------------------------------------------------#
+#                       Action                             #
+#----------------------------------------------------------#
 
 # Parsing config / or just source config
 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
 
-# Logging
+
+#----------------------------------------------------------#
+#                       Vesta                              #
+#----------------------------------------------------------#
+
 exit

+ 5 - 1
bin/v_suspend_cron_job

@@ -1,5 +1,9 @@
 #!/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                     #

+ 4 - 0
bin/v_suspend_cron_jobs

@@ -1,5 +1,9 @@
 #!/bin/bash
 # info: Suspending sys cron jobs
+# arguments: user
+#
+# The function suspends all user cron jobs.
+
 
 #----------------------------------------------------------#
 #                    Variable&Function                     #

+ 5 - 1
bin/v_unsuspend_cron_job

@@ -1,5 +1,9 @@
 #!/bin/bash
-# info: Unuspending sys cron
+# info: unuspend cron job
+# arguments: user job
+#
+# The function unsuspen certain cron job.
+
 
 #----------------------------------------------------------#
 #                    Variable&Function                     #

+ 5 - 1
bin/v_unsuspend_cron_jobs

@@ -1,5 +1,9 @@
 #!/bin/bash
-# info: Unuspending sys cron
+# info: unuspend sys cron
+# arguments: user
+#
+# The function unsuspends all suspended cron jobs.
+
 
 #----------------------------------------------------------#
 #                    Variable&Function                     #