Handling user agent during user files backup

This commit is contained in:
Bob Mottram 2018-02-17 14:41:45 +00:00
parent d528d904cc
commit 6e5ffcc9ea
2 changed files with 5 additions and 0 deletions

View File

@ -113,6 +113,7 @@ function backup_users {
for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
gpg_agent_setup $USERNAME
# Backup any gpg keys
if [ -d /home/$USERNAME/.gnupg ]; then
@ -212,6 +213,8 @@ function backup_users {
cp /home/$USERNAME/.procmailrc /home/$USERNAME/tempbackup
backup_directory_to_usb /home/$USERNAME/tempbackup procmail/$USERNAME
fi
gpg_agent_enable $USERNAME
fi
done
}

View File

@ -157,6 +157,7 @@ function backup_users {
for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
gpg_agent_setup $USERNAME
# personal settings
if [ -d /home/$USERNAME/personal ]; then
@ -266,6 +267,7 @@ function backup_users {
echo $"Backing up emails for $USERNAME"
backup_directory_to_friend /root/backupemail/$USERNAME mail/$USERNAME
fi
gpg_agent_enable $USERNAME
fi
done
}