mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
refactoring: log_event(), is_format_valid()
This commit is contained in:
parent
6e0ef668bb
commit
e05dca61a6
211 changed files with 756 additions and 1091 deletions
|
@ -34,6 +34,11 @@ fi
|
|||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Generating timestamp
|
||||
time_n_date=$(date +'%T %F')
|
||||
time=$(echo "$time_n_date" |cut -f 1 -d \ )
|
||||
date=$(echo "$time_n_date" |cut -f 2 -d \ )
|
||||
|
||||
# Define time somewhere at night
|
||||
min=$(gen_password '012345' '2')
|
||||
hour=$(gen_password '1234567' '1')
|
||||
|
@ -44,7 +49,7 @@ command='sudo /usr/local/vesta/bin/v-update-sys-vesta-all'
|
|||
|
||||
# Concatenating cron string
|
||||
str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month' WDAY='$wday'"
|
||||
str="$str CMD='$command' SUSPENDED='no' TIME='$TIME' DATE='$DATE'"
|
||||
str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'"
|
||||
|
||||
# Adding to crontab
|
||||
echo "$str" >> $VESTA/data/users/$user/cron.conf
|
||||
|
@ -72,6 +77,6 @@ check_result $? "Cron restart failed" >/dev/null
|
|||
|
||||
# Logging
|
||||
log_history "added cron job $job"
|
||||
log_event "$OK" "$EVENT"
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue