Квоты на CentOS и Vesta

Для включения квот

1
 sudo /usr/local/vesta/bin/v-add-sys-quota
 sudo /usr/local/vesta/bin/v-add-sys-quota

Для автоматического обновления квот скрипт для запуска в cron:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# info: update user statistics
# options: USER
#
# Function logs user parameters into statistics database.
 
 
#----------------------------------------------------------#
#                    Variable&Function                     #
#----------------------------------------------------------#
 
# Argument defenition
user=$1
 
# Importing system enviroment  as we run this script
#       mostly by cron wich not read it by itself
source /etc/profile
 
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
 
 
#----------------------------------------------------------#
#                       Action                             #
#----------------------------------------------------------#
 
# Creating user_list
if [ -z "$user" ]; then
    user_list=$(ls $VESTA/data/users)
else
    user_list="$user"
fi
 
# Updating sys quotas
for user in $user_list; do
    QUOTA_UPDATE=$VESTA/bin/v-update-user-quota
    sudo ${QUOTA_UPDATE} $user
done
 
exit
#!/bin/bash
# info: update user statistics
# options: USER
#
# Function logs user parameters into statistics database.


#----------------------------------------------------------#
#                    Variable&Function                     #
#----------------------------------------------------------#

# Argument defenition
user=$1

# Importing system enviroment  as we run this script
#       mostly by cron wich not read it by itself
source /etc/profile

# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf


#----------------------------------------------------------#
#                       Action                             #
#----------------------------------------------------------#

# Creating user_list
if [ -z "$user" ]; then
    user_list=$(ls $VESTA/data/users)
else
    user_list="$user"
fi

# Updating sys quotas
for user in $user_list; do
    QUOTA_UPDATE=$VESTA/bin/v-update-user-quota
    sudo ${QUOTA_UPDATE} $user
done

exit

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *