mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 05:44:07 -07:00
renamed crontab.conf to cron.conf
This commit is contained in:
parent
eaf4f14776
commit
2464b9f47c
8 changed files with 19 additions and 19 deletions
|
@ -59,7 +59,7 @@ v_str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month"
|
||||||
v_str="$v_str' WDAY='$wday' CMD='$command' SUSPEND='no' DATE='$V_DATE'"
|
v_str="$v_str' WDAY='$wday' CMD='$command' SUSPEND='no' DATE='$V_DATE'"
|
||||||
|
|
||||||
# Adding to crontab
|
# Adding to crontab
|
||||||
echo "$v_str">>$V_USERS/$user/crontab.conf
|
echo "$v_str">>$V_USERS/$user/cron.conf
|
||||||
|
|
||||||
# Sorting jobs by id
|
# Sorting jobs by id
|
||||||
sort_cron_jobs
|
sort_cron_jobs
|
||||||
|
|
|
@ -140,7 +140,7 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'no' ]; then
|
if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'no' ]; then
|
||||||
touch $V_USERS/$user/crontab.conf
|
touch $V_USERS/$user/cron.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$BACKUP_SYSTEM" ] && [ "$BACKUP_SYSTEM" != 'no' ]; then
|
if [ ! -z "$BACKUP_SYSTEM" ] && [ "$BACKUP_SYSTEM" != 'no' ]; then
|
||||||
|
|
|
@ -59,7 +59,7 @@ v_str="$v_str MONTH='$month' DAY='$day' CMD='$command' SUSPEND='no'"
|
||||||
del_cron_job
|
del_cron_job
|
||||||
|
|
||||||
# Adding to crontab
|
# Adding to crontab
|
||||||
echo "$v_str">>$V_USERS/$user/crontab.conf
|
echo "$v_str">>$V_USERS/$user/cron.conf
|
||||||
|
|
||||||
# Sorting jobs by id
|
# Sorting jobs by id
|
||||||
sort_cron_jobs
|
sort_cron_jobs
|
||||||
|
|
|
@ -36,7 +36,7 @@ is_user_valid
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Defining config
|
# Defining config
|
||||||
conf="$V_USERS/$user/crontab.conf"
|
conf="$V_USERS/$user/cron.conf"
|
||||||
|
|
||||||
# Defining fileds to select
|
# Defining fileds to select
|
||||||
fields='$JOB $MIN $HOUR $DAY $MONTH $WDAY $CMD $SUSPEND $DATE'
|
fields='$JOB $MIN $HOUR $DAY $MONTH $WDAY $CMD $SUSPEND $DATE'
|
||||||
|
|
|
@ -33,7 +33,7 @@ is_user_valid
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Searching jobs
|
# Searching jobs
|
||||||
conf="$V_USERS/$user/crontab.conf"
|
conf="$V_USERS/$user/cron.conf"
|
||||||
field='$JOB'
|
field='$JOB'
|
||||||
search_string="SUSPEND='no'"
|
search_string="SUSPEND='no'"
|
||||||
jobs=$(cron_clear_search)
|
jobs=$(cron_clear_search)
|
||||||
|
|
|
@ -33,7 +33,7 @@ is_user_valid
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Searching jobs
|
# Searching jobs
|
||||||
conf="$V_USERS/$user/crontab.conf"
|
conf="$V_USERS/$user/cron.conf"
|
||||||
field='$JOB'
|
field='$JOB'
|
||||||
search_string="SUSPEND='yes'"
|
search_string="SUSPEND='yes'"
|
||||||
jobs=$(cron_clear_search)
|
jobs=$(cron_clear_search)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
get_next_cron_string() {
|
get_next_cron_string() {
|
||||||
# Parsing config
|
# Parsing config
|
||||||
curr_str=$(grep "JOB=" $V_USERS/$user/crontab.conf|cut -f 2 -d \'|\
|
curr_str=$(grep "JOB=" $V_USERS/$user/cron.conf|cut -f 2 -d \'|\
|
||||||
sort -n|tail -n1)
|
sort -n|tail -n1)
|
||||||
|
|
||||||
# Print result
|
# Print result
|
||||||
|
@ -9,7 +9,7 @@ get_next_cron_string() {
|
||||||
|
|
||||||
is_cron_job_free() {
|
is_cron_job_free() {
|
||||||
# Checking record id
|
# Checking record id
|
||||||
check_job=$(grep "JOB='$job'" $V_USERS/$user/crontab.conf)
|
check_job=$(grep "JOB='$job'" $V_USERS/$user/cron.conf)
|
||||||
|
|
||||||
if [ ! -z "$check_job" ]; then
|
if [ ! -z "$check_job" ]; then
|
||||||
echo "Error: job exist"
|
echo "Error: job exist"
|
||||||
|
@ -20,7 +20,7 @@ is_cron_job_free() {
|
||||||
|
|
||||||
sort_cron_jobs() {
|
sort_cron_jobs() {
|
||||||
# Defining conf
|
# Defining conf
|
||||||
conf="$V_USERS/$user/crontab.conf"
|
conf="$V_USERS/$user/cron.conf"
|
||||||
cat $conf |sort -n -k 2 -t \' >$conf.tmp
|
cat $conf |sort -n -k 2 -t \' >$conf.tmp
|
||||||
mv -f $conf.tmp $conf
|
mv -f $conf.tmp $conf
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ sync_cron_jobs() {
|
||||||
echo "MAILTO=$email" >$conf
|
echo "MAILTO=$email" >$conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Reading user crontab.conf
|
# Reading user cron.conf
|
||||||
while read line ; do
|
while read line ; do
|
||||||
# Defining new delimeter
|
# Defining new delimeter
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
@ -53,12 +53,12 @@ sync_cron_jobs() {
|
||||||
echo "$MIN $HOUR $DAY $MONTH $WDAY $CMD" |\
|
echo "$MIN $HOUR $DAY $MONTH $WDAY $CMD" |\
|
||||||
sed -e "s/%quote%/'/g" -e "s/%dots%/:/g" >> $conf
|
sed -e "s/%quote%/'/g" -e "s/%dots%/:/g" >> $conf
|
||||||
fi
|
fi
|
||||||
done <$V_USERS/$user/crontab.conf
|
done <$V_USERS/$user/cron.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
is_job_valid() {
|
is_job_valid() {
|
||||||
result=$(grep "JOB='$job'" $V_USERS/$user/crontab.conf)
|
result=$(grep "JOB='$job'" $V_USERS/$user/cron.conf)
|
||||||
|
|
||||||
if [ -z "$result" ]; then
|
if [ -z "$result" ]; then
|
||||||
echo "Error: job not exists"
|
echo "Error: job not exists"
|
||||||
|
@ -68,8 +68,8 @@ is_job_valid() {
|
||||||
}
|
}
|
||||||
|
|
||||||
del_cron_job() {
|
del_cron_job() {
|
||||||
str=$(grep -n "JOB='$job'" $V_USERS/$user/crontab.conf|cut -f 1 -d :)
|
str=$(grep -n "JOB='$job'" $V_USERS/$user/cron.conf|cut -f 1 -d :)
|
||||||
sed -i "$str d" $V_USERS/$user/crontab.conf
|
sed -i "$str d" $V_USERS/$user/cron.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
crn_json_list() {
|
crn_json_list() {
|
||||||
|
@ -163,7 +163,7 @@ crn_shell_list() {
|
||||||
|
|
||||||
is_job_suspended() {
|
is_job_suspended() {
|
||||||
# Parsing jobs
|
# Parsing jobs
|
||||||
str=$(grep "JOB='$job'" $V_USERS/$user/crontab.conf|grep "SUSPEND='yes'" )
|
str=$(grep "JOB='$job'" $V_USERS/$user/cron.conf|grep "SUSPEND='yes'" )
|
||||||
|
|
||||||
# Checkng key
|
# Checkng key
|
||||||
if [ ! -z "$str" ]; then
|
if [ ! -z "$str" ]; then
|
||||||
|
@ -175,7 +175,7 @@ is_job_suspended() {
|
||||||
|
|
||||||
is_job_unsuspended() {
|
is_job_unsuspended() {
|
||||||
# Parsing jobs
|
# Parsing jobs
|
||||||
str=$(grep "JOB='$job'" $V_USERS/$user/crontab.conf|grep "SUSPEND='no'" )
|
str=$(grep "JOB='$job'" $V_USERS/$user/cron.conf|grep "SUSPEND='no'" )
|
||||||
|
|
||||||
# Checkng key
|
# Checkng key
|
||||||
if [ ! -z "$str" ]; then
|
if [ ! -z "$str" ]; then
|
||||||
|
@ -190,7 +190,7 @@ update_cron_job_value() {
|
||||||
value="$2"
|
value="$2"
|
||||||
|
|
||||||
# Defining conf
|
# Defining conf
|
||||||
conf="$V_USERS/$user/crontab.conf"
|
conf="$V_USERS/$user/cron.conf"
|
||||||
|
|
||||||
# Parsing conf
|
# Parsing conf
|
||||||
job_str=$(grep -n "JOB='$job'" $conf)
|
job_str=$(grep -n "JOB='$job'" $conf)
|
||||||
|
|
|
@ -5,11 +5,11 @@ is_domain_new() {
|
||||||
|
|
||||||
# Parsing domain values
|
# Parsing domain values
|
||||||
check_domain=$(grep -F "DOMAIN='$search_dom'" $V_USERS/*/*.conf| \
|
check_domain=$(grep -F "DOMAIN='$search_dom'" $V_USERS/*/*.conf| \
|
||||||
grep -v crontab.conf)
|
grep -v cron.conf)
|
||||||
|
|
||||||
# Parsing alias values
|
# Parsing alias values
|
||||||
check_alias=$(grep -F 'ALIAS=' $V_USERS/*/*.conf | \
|
check_alias=$(grep -F 'ALIAS=' $V_USERS/*/*.conf | \
|
||||||
grep -v crontab.conf | \
|
grep -v cron.conf | \
|
||||||
awk -F "ALIAS=" '{print $2}' | \
|
awk -F "ALIAS=" '{print $2}' | \
|
||||||
cut -f 2 -d \' | \
|
cut -f 2 -d \' | \
|
||||||
sed -e "s/,/\n/g" | \
|
sed -e "s/,/\n/g" | \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue