mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 21:34:12 -07:00
added pam to backup
This commit is contained in:
parent
46c165db4d
commit
a1b8f49868
3 changed files with 36 additions and 11 deletions
|
@ -15,7 +15,6 @@ source $V_CONF/vesta.conf
|
||||||
source $V_FUNC/shared.func
|
source $V_FUNC/shared.func
|
||||||
source $V_FUNC/domain.func
|
source $V_FUNC/domain.func
|
||||||
source $V_FUNC/db.func
|
source $V_FUNC/db.func
|
||||||
source $V_CONF/vesta.conf
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
@ -78,12 +77,14 @@ fi
|
||||||
# Addding backup and vesta version
|
# Addding backup and vesta version
|
||||||
echo "1.0" > $tmpdir/backup_version
|
echo "1.0" > $tmpdir/backup_version
|
||||||
echo "$VERSION" > $tmpdir/vesta_version
|
echo "$VERSION" > $tmpdir/vesta_version
|
||||||
vst='yes'
|
|
||||||
|
|
||||||
|
|
||||||
# Vesta
|
# Vesta
|
||||||
if [ -z "$output" ]; then
|
if [ -z "$output" ]; then
|
||||||
echo "-- VESTA --"
|
echo "-- VESTA --"
|
||||||
fi
|
fi
|
||||||
|
vst='yes'
|
||||||
mkdir $tmpdir/vesta
|
mkdir $tmpdir/vesta
|
||||||
|
|
||||||
# Backingup vesta configs
|
# Backingup vesta configs
|
||||||
|
@ -151,6 +152,24 @@ if [ -e "$V_USERS/$user/web.conf" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ -z "$output" ]; then
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
# PAM
|
||||||
|
if [ -z "$output" ]; then
|
||||||
|
echo "-- PAM --"
|
||||||
|
fi
|
||||||
|
pam='yes'
|
||||||
|
mkdir $tmpdir/pam
|
||||||
|
if [ -z "$output" ]; then
|
||||||
|
echo -e "\t$(date +%H:%M:%S) passwd / shadow /group"
|
||||||
|
fi
|
||||||
|
|
||||||
|
grep "^$user:" /etc/passwd > $tmpdir/pam/passwd
|
||||||
|
grep "^$user:" /etc/shadow > $tmpdir/pam/shadow
|
||||||
|
grep "^$user:" /etc/group > $tmpdir/pam/group
|
||||||
|
|
||||||
if [ -z "$output" ]; then
|
if [ -z "$output" ]; then
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
@ -545,8 +564,7 @@ ftp_backup(){
|
||||||
backup_list=$(ftpc "ls" |awk '{print $9}' |grep "^$user\.")
|
backup_list=$(ftpc "ls" |awk '{print $9}' |grep "^$user\.")
|
||||||
backups_count=$(echo "$backup_list" | wc -l)
|
backups_count=$(echo "$backup_list" | wc -l)
|
||||||
if [ "$backups_count" -ge "$BACKUPS" ]; then
|
if [ "$backups_count" -ge "$BACKUPS" ]; then
|
||||||
# Removing old backups
|
backups_rm_number=$((backups_count - BACKUPS + 1))
|
||||||
backups_rm_number=$((backups_count - BACKUPS))
|
|
||||||
for backup in $(echo "$backup_list" | tail -n $backups_rm_number); do
|
for backup in $(echo "$backup_list" | tail -n $backups_rm_number); do
|
||||||
backup_date=$(echo $backup | sed -e "s/$user.//" -e "s/.tar$//")
|
backup_date=$(echo $backup | sed -e "s/$user.//" -e "s/.tar$//")
|
||||||
deprecated="$deprecated $backup"
|
deprecated="$deprecated $backup"
|
||||||
|
@ -621,6 +639,7 @@ done
|
||||||
backup_str="DATE='$V_DATE' TIME='$current_time' RUNTIME='$run_time'"
|
backup_str="DATE='$V_DATE' TIME='$current_time' RUNTIME='$run_time'"
|
||||||
backup_str="$backup_str TYPE='$BACKUP_SYSTEM' SIZE='$size'"
|
backup_str="$backup_str TYPE='$BACKUP_SYSTEM' SIZE='$size'"
|
||||||
backup_str="$backup_str VESTA='$vst'"
|
backup_str="$backup_str VESTA='$vst'"
|
||||||
|
backup_str="$backup_str PAM='$pam'"
|
||||||
backup_str="$backup_str WEB='${web_list// /,}'"
|
backup_str="$backup_str WEB='${web_list// /,}'"
|
||||||
backup_str="$backup_str DNS='${dns_list// /,}'"
|
backup_str="$backup_str DNS='${dns_list// /,}'"
|
||||||
backup_str="$backup_str MAIL='${mail_list// /,}'"
|
backup_str="$backup_str MAIL='${mail_list// /,}'"
|
||||||
|
|
|
@ -38,8 +38,8 @@ if [ ! -e "$conf" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Defining fileds to select
|
# Defining fileds to select
|
||||||
fields="\$DATE \$TIME \$RUNTIME \$TYPE \$SIZE \$VESTA \$WEB \$DNS \$DB \$MAIL"
|
fields="\$DATE \$TIME \$RUNTIME \$TYPE \$SIZE \$VESTA \$PAM \$WEB \$DNS \$DB"
|
||||||
fields="$fields \$CERTIFICATES \$CRON"
|
fields="$fields \$MAIL \$CERTIFICATES \$CRON"
|
||||||
|
|
||||||
# Listing domains
|
# Listing domains
|
||||||
case $format in
|
case $format in
|
||||||
|
|
|
@ -33,6 +33,14 @@ get_backup_info() {
|
||||||
vst='yes'
|
vst='yes'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Checking pam
|
||||||
|
pam_data=$(echo "$backup_data" |grep "^./pam/" |grep -v "^./pam/$")
|
||||||
|
if [ -z "$pam_data" ]; then
|
||||||
|
pam=''
|
||||||
|
else
|
||||||
|
pam='yes'
|
||||||
|
fi
|
||||||
|
|
||||||
# Checking web data
|
# Checking web data
|
||||||
web_data=$(echo "$backup_data" |grep "^./web/" |grep -v "^./web/$" |sort)
|
web_data=$(echo "$backup_data" |grep "^./web/" |grep -v "^./web/$" |sort)
|
||||||
if [ -z "$web_data" ]; then
|
if [ -z "$web_data" ]; then
|
||||||
|
@ -127,11 +135,9 @@ get_backup_info() {
|
||||||
cron='yes'
|
cron='yes'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
str="DATE='$backup_date' TIME='$backup_time' RUNTIME='0'"
|
echo -n "DATE='$backup_date' TIME='$backup_time' RUNTIME='0'"
|
||||||
str="$str SIZE='$backup_size' TYPE='$backup_type' VESTA='$vst' WEB='$web'"
|
echo -n " SIZE='$backup_size' TYPE='$backup_type' VESTA='$vst' PAM='$pam'"
|
||||||
str="$str DNS='$dns' MAIL='$ml' DB='$db' SSL='$ssl' CRON='$cron'"
|
echo " WEB='$web' DNS='$dns' MAIL='$ml' DB='$db' SSL='$ssl' CRON='$cron'"
|
||||||
|
|
||||||
echo "$str"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Defining ftp command function
|
# Defining ftp command function
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue