mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
replaced underscore with dash in api syscalls
This commit is contained in:
parent
7ed705cee7
commit
b6b7eacadb
283 changed files with 438 additions and 412 deletions
62
bin/v-delete-cron-job
Executable file
62
bin/v-delete-cron-job
Executable file
|
@ -0,0 +1,62 @@
|
|||
#!/bin/bash
|
||||
# info: delete cron job
|
||||
# options: user job
|
||||
#
|
||||
# The function deletes cron job.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
job=$2
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'user job'
|
||||
validate_format 'user' 'job'
|
||||
is_system_enabled "$CRON_SYSTEM"
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
is_object_valid 'cron' 'JOB' "$job"
|
||||
is_object_unsuspended 'cron' 'JOB' "$job"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Deleting job
|
||||
sed -i "/JOB='$job' /d" $USER_DATA/cron.conf
|
||||
|
||||
# Sorting jobs by id
|
||||
sort_cron_jobs
|
||||
|
||||
# Sync system cron with user
|
||||
sync_cron_jobs
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Decreasing cron value
|
||||
decrease_user_value "$user" '$U_CRON_JOBS'
|
||||
|
||||
# Restart crond
|
||||
$BIN/v-restart-cron "$EVENT"
|
||||
|
||||
# Logging
|
||||
log_history "deleted cron job $job"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue