1
0
mirror of https://github.com/serghey-rodin/vesta.git synced 2025-03-12 04:36:25 -07:00
vesta/bin/v-update-databases-disk

48 lines
1.3 KiB
Plaintext
Raw Normal View History

2013-01-19 23:07:26 +02:00
#!/bin/bash
# info: update databases disk usage
# options: USER
#
# The function recalculates disk usage for all user databases.
#----------------------------------------------------------#
# 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 "$DB_SYSTEM" 'DB_SYSTEM'
2013-01-19 23:07:26 +02:00
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" "$ARGUMENTS"
2013-01-19 23:07:26 +02:00
exit