mirror of
https://github.com/myvesta/vesta
synced 2025-07-16 10:03:23 -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
60
bin/v-update-database-disk
Executable file
60
bin/v-update-database-disk
Executable file
|
@ -0,0 +1,60 @@
|
|||
#!/bin/bash
|
||||
# info: update database disk usage
|
||||
# options: user database
|
||||
#
|
||||
# The function recalculates disk usage for speciefic database.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
database=$2
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/func/db.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'user database'
|
||||
validate_format 'user' 'database'
|
||||
is_system_enabled "$DB_SYSTEM"
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
is_object_valid 'db' 'DB' "$database"
|
||||
is_object_unsuspended 'db' 'DB' "$database"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Get database values
|
||||
get_database_values
|
||||
|
||||
# Switching on db type
|
||||
case $TYPE in
|
||||
mysql) get_mysql_disk_usage ;;
|
||||
pgsql) get_pgsql_disk_usage ;;
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Updating disk usage
|
||||
update_object_value 'db' 'DB' "$database" '$U_DISK' "$usage"
|
||||
recalc_user_disk_usage
|
||||
|
||||
# Logging
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue