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/domain.func
|
||||
source $V_FUNC/db.func
|
||||
source $V_CONF/vesta.conf
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
|
@ -78,12 +77,14 @@ fi
|
|||
# Addding backup and vesta version
|
||||
echo "1.0" > $tmpdir/backup_version
|
||||
echo "$VERSION" > $tmpdir/vesta_version
|
||||
vst='yes'
|
||||
|
||||
|
||||
|
||||
# Vesta
|
||||
if [ -z "$output" ]; then
|
||||
echo "-- VESTA --"
|
||||
fi
|
||||
vst='yes'
|
||||
mkdir $tmpdir/vesta
|
||||
|
||||
# Backingup vesta configs
|
||||
|
@ -151,6 +152,24 @@ if [ -e "$V_USERS/$user/web.conf" ]; then
|
|||
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
|
||||
echo
|
||||
fi
|
||||
|
@ -545,8 +564,7 @@ ftp_backup(){
|
|||
backup_list=$(ftpc "ls" |awk '{print $9}' |grep "^$user\.")
|
||||
backups_count=$(echo "$backup_list" | wc -l)
|
||||
if [ "$backups_count" -ge "$BACKUPS" ]; then
|
||||
# Removing old backups
|
||||
backups_rm_number=$((backups_count - BACKUPS))
|
||||
backups_rm_number=$((backups_count - BACKUPS + 1))
|
||||
for backup in $(echo "$backup_list" | tail -n $backups_rm_number); do
|
||||
backup_date=$(echo $backup | sed -e "s/$user.//" -e "s/.tar$//")
|
||||
deprecated="$deprecated $backup"
|
||||
|
@ -621,6 +639,7 @@ done
|
|||
backup_str="DATE='$V_DATE' TIME='$current_time' RUNTIME='$run_time'"
|
||||
backup_str="$backup_str TYPE='$BACKUP_SYSTEM' SIZE='$size'"
|
||||
backup_str="$backup_str VESTA='$vst'"
|
||||
backup_str="$backup_str PAM='$pam'"
|
||||
backup_str="$backup_str WEB='${web_list// /,}'"
|
||||
backup_str="$backup_str DNS='${dns_list// /,}'"
|
||||
backup_str="$backup_str MAIL='${mail_list// /,}'"
|
||||
|
|
|
@ -38,8 +38,8 @@ if [ ! -e "$conf" ]; then
|
|||
fi
|
||||
|
||||
# Defining fileds to select
|
||||
fields="\$DATE \$TIME \$RUNTIME \$TYPE \$SIZE \$VESTA \$WEB \$DNS \$DB \$MAIL"
|
||||
fields="$fields \$CERTIFICATES \$CRON"
|
||||
fields="\$DATE \$TIME \$RUNTIME \$TYPE \$SIZE \$VESTA \$PAM \$WEB \$DNS \$DB"
|
||||
fields="$fields \$MAIL \$CERTIFICATES \$CRON"
|
||||
|
||||
# Listing domains
|
||||
case $format in
|
||||
|
|
|
@ -33,6 +33,14 @@ get_backup_info() {
|
|||
vst='yes'
|
||||
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
|
||||
web_data=$(echo "$backup_data" |grep "^./web/" |grep -v "^./web/$" |sort)
|
||||
if [ -z "$web_data" ]; then
|
||||
|
@ -127,11 +135,9 @@ get_backup_info() {
|
|||
cron='yes'
|
||||
fi
|
||||
|
||||
str="DATE='$backup_date' TIME='$backup_time' RUNTIME='0'"
|
||||
str="$str SIZE='$backup_size' TYPE='$backup_type' VESTA='$vst' WEB='$web'"
|
||||
str="$str DNS='$dns' MAIL='$ml' DB='$db' SSL='$ssl' CRON='$cron'"
|
||||
|
||||
echo "$str"
|
||||
echo -n "DATE='$backup_date' TIME='$backup_time' RUNTIME='0'"
|
||||
echo -n " SIZE='$backup_size' TYPE='$backup_type' VESTA='$vst' PAM='$pam'"
|
||||
echo " WEB='$web' DNS='$dns' MAIL='$ml' DB='$db' SSL='$ssl' CRON='$cron'"
|
||||
}
|
||||
|
||||
# Defining ftp command function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue