1
0
mirror of https://github.com/serghey-rodin/vesta.git synced 2025-03-11 20:26:30 -07:00
vesta/bin/v-delete-cron-reports

56 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2013-01-19 23:07:26 +02:00
#!/bin/bash
# info: delete cron reports
# options: USER
#
# The script for disabling reports on cron tasks and administrative
# notifications.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
2015-11-06 17:38:58 +02:00
# Argument definition
2013-01-19 23:07:26 +02:00
user=$1
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
2013-01-19 23:07:26 +02:00
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'USER'
is_format_valid 'user'
2013-05-29 13:16:09 +03:00
is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
2013-01-19 23:07:26 +02:00
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Changing user report value
update_user_value "$user" '$CRON_REPORTS' 'no'
# Sync system cron with user
sync_cron_jobs
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
2015-10-28 16:34:41 +02:00
# Restarting crond
2013-06-01 14:25:44 +03:00
$BIN/v-restart-cron
2015-10-28 16:34:41 +02:00
check_result $? "Cron restart failed" >/dev/null
2013-01-19 23:07:26 +02:00
# Logging
log_history "disabled cron reporting"
log_event "$OK" "$ARGUMENTS"
2013-01-19 23:07:26 +02:00
exit