Backup user files in .local
Which includes profanity settings
This commit is contained in:
parent
1f021fb5a2
commit
07427dcbda
|
@ -295,6 +295,12 @@ function backup_users {
|
||||||
backup_directory_to_usb /home/$USERNAME/.config config/$USERNAME
|
backup_directory_to_usb /home/$USERNAME/.config config/$USERNAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Backup user local
|
||||||
|
if [ -d /home/$USERNAME/.local ]; then
|
||||||
|
echo $"Backing up local files for $USERNAME"
|
||||||
|
backup_directory_to_usb /home/$USERNAME/.local local/$USERNAME
|
||||||
|
fi
|
||||||
|
|
||||||
# Backup mutt
|
# Backup mutt
|
||||||
if [ -f /home/$USERNAME/.muttrc ]; then
|
if [ -f /home/$USERNAME/.muttrc ]; then
|
||||||
echo $"Backing up Mutt settings for $USERNAME"
|
echo $"Backing up Mutt settings for $USERNAME"
|
||||||
|
|
|
@ -204,6 +204,12 @@ function backup_users {
|
||||||
backup_directory_to_friend /home/$USERNAME/.config config/$USERNAME
|
backup_directory_to_friend /home/$USERNAME/.config config/$USERNAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# local files
|
||||||
|
if [ -d /home/$USERNAME/.local ]; then
|
||||||
|
echo $"Backing up local files for $USERNAME"
|
||||||
|
backup_directory_to_friend /home/$USERNAME/.local local/$USERNAME
|
||||||
|
fi
|
||||||
|
|
||||||
# mutt settings
|
# mutt settings
|
||||||
if [ -f /home/$USERNAME/.muttrc ]; then
|
if [ -f /home/$USERNAME/.muttrc ]; then
|
||||||
echo $"Backing up Mutt settings for $USERNAME"
|
echo $"Backing up Mutt settings for $USERNAME"
|
||||||
|
|
|
@ -596,6 +596,33 @@ function restore_user_config {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function restore_user_local {
|
||||||
|
if [[ $RESTORE_APP != 'all' ]]; then
|
||||||
|
if [[ $RESTORE_APP != 'userlocal' ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -d $USB_MOUNT/backup/local ]; then
|
||||||
|
for d in $USB_MOUNT/backup/local/*/ ; do
|
||||||
|
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||||
|
if [[ $USERNAME != "git" && $USRNAME != "mirrors" ]]; then
|
||||||
|
if [ ! -d /home/$USERNAME ]; then
|
||||||
|
${PROJECT_NAME}-adduser $USERNAME
|
||||||
|
fi
|
||||||
|
echo $"Restoring local files for $USERNAME"
|
||||||
|
restore_directory_from_usb /root/templocal local/$USERNAME
|
||||||
|
cp -r /root/templocal/home/$USERNAME/.local /home/$USERNAME/
|
||||||
|
if [ ! "$?" = "0" ]; then
|
||||||
|
rm -rf /root/templocal
|
||||||
|
unmount_drive
|
||||||
|
exit 664
|
||||||
|
fi
|
||||||
|
rm -rf /root/templocal
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function restore_certs {
|
function restore_certs {
|
||||||
if [[ $RESTORE_APP != 'all' ]]; then
|
if [[ $RESTORE_APP != 'all' ]]; then
|
||||||
if [[ $RESTORE_APP != 'certs' ]]; then
|
if [[ $RESTORE_APP != 'certs' ]]; then
|
||||||
|
@ -1065,6 +1092,7 @@ restore_admin_readme
|
||||||
restore_ipfs
|
restore_ipfs
|
||||||
restore_user_ssh_keys
|
restore_user_ssh_keys
|
||||||
restore_user_config
|
restore_user_config
|
||||||
|
restore_user_local
|
||||||
restore_certs
|
restore_certs
|
||||||
restore_personal_settings
|
restore_personal_settings
|
||||||
restore_mailing_list
|
restore_mailing_list
|
||||||
|
|
|
@ -476,6 +476,32 @@ function restore_user_config {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function restore_user_local {
|
||||||
|
if [[ $RESTORE_APP != 'all' ]]; then
|
||||||
|
if [[ $RESTORE_APP != 'userlocal' ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
for d in $SERVER_DIRECTORY/backup/local/*/ ; do
|
||||||
|
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||||
|
if [[ $USERNAME != "git" && $USRNAME != "mirrors" ]]; then
|
||||||
|
if [ -d $SERVER_DIRECTORY/backup/local/$USERNAME ]; then
|
||||||
|
if [ ! -d /home/$USERNAME ]; then
|
||||||
|
${PROJECT_NAME}-adduser $USERNAME
|
||||||
|
fi
|
||||||
|
echo $"Restoring local files for $USERNAME"
|
||||||
|
restore_directory_from_friend /root/templocal local/$USERNAME
|
||||||
|
cp -r /root/templocal/home/$USERNAME/.local /home/$USERNAME/
|
||||||
|
if [ ! "$?" = "0" ]; then
|
||||||
|
rm -rf /root/templocal
|
||||||
|
exit 664
|
||||||
|
fi
|
||||||
|
rm -rf /root/templocal
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
function restore_certs {
|
function restore_certs {
|
||||||
if [[ $RESTORE_APP != 'all' ]]; then
|
if [[ $RESTORE_APP != 'all' ]]; then
|
||||||
if [[ $RESTORE_APP != 'certs' ]]; then
|
if [[ $RESTORE_APP != 'certs' ]]; then
|
||||||
|
@ -919,6 +945,7 @@ restore_admin_readme
|
||||||
restore_ipfs
|
restore_ipfs
|
||||||
restore_ssh_keys
|
restore_ssh_keys
|
||||||
restore_user_config
|
restore_user_config
|
||||||
|
restore_user_local
|
||||||
restore_certs
|
restore_certs
|
||||||
restore_personal_settings
|
restore_personal_settings
|
||||||
restore_mailing_list
|
restore_mailing_list
|
||||||
|
|
Loading…
Reference in New Issue