mirror of
https://github.com/myvesta/vesta
synced 2025-07-16 10:03:23 -07:00
Refactoring stage III (db)
This commit is contained in:
parent
4fa3013716
commit
33717629f7
21 changed files with 518 additions and 913 deletions
47
bin/v_update_databases_disk
Executable file
47
bin/v_update_databases_disk
Executable file
|
@ -0,0 +1,47 @@
|
|||
#!/bin/bash
|
||||
# info: update databases disk usage
|
||||
# options: user
|
||||
#
|
||||
# The function recalculates disk usage for all user databases.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
|
||||
# Importing variables
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/shared.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '1' "$#" 'user'
|
||||
validate_format 'user'
|
||||
is_system_enabled "$DB_SYSTEM"
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Starting update loop
|
||||
for database in $(search_objects 'db' 'SUSPENDED' "no" 'DB'); do
|
||||
$BIN/v_update_database_disk "$user" "$database"
|
||||
done
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue