From 9804b19db199908e1f6c62e0d733410fb9c7391e Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Thu, 16 Jan 2025 03:07:41 -0700 Subject: [PATCH] Backup - Added SSH keys to the list. Add the ability to preview the list of files backed up --- overlay/opt/emcomm-tools/bin/et-user-backup | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/overlay/opt/emcomm-tools/bin/et-user-backup b/overlay/opt/emcomm-tools/bin/et-user-backup index 6eacfbe..f086a60 100755 --- a/overlay/opt/emcomm-tools/bin/et-user-backup +++ b/overlay/opt/emcomm-tools/bin/et-user-backup @@ -7,6 +7,7 @@ # The backups are limited to the following: # 1. EmComm Tools configuration # 2. Winlink email +# 3. SSH keys TODAY=$(date +"%Y%m%d") BACKUP_FILE="${HOME}/etc-user-backup-${HOSTNAME}-${TODAY}.tar.gz" @@ -30,6 +31,7 @@ BACKUP_DIRS=( ".config/emcomm-tools" ".local/share/emcomm-tools" ".local/share/pat" + ".ssh" ) tar -czf ${BACKUP_FILE} \ @@ -49,4 +51,15 @@ for dir in "${BACKUP_DIRS[@]}"; do echo "* $dir" done -echo -e "\n${YELLOW}If you need files outside of these directories, please back them up manually.${NC}" +echo -e "\nIf you need files outside of these directories, please back them up manually.\n${NC}" + +read -p "Do you want see the full list of files backed up? (y/n) " response +[[ $response != [yY] ]] && exit 0 + +echo -e "1. ${YELLOW}Press ${WHITE}[SPACE]${YELLOW} to page through the list of files.${NC}" +echo -e "2. ${YELLOW}Press ${WHITE}[UP/DOWN]${YELLOW} to scroll through the list of files.${NC}" +echo -e "3. ${YELLOW}Press ${WHITE}q${YELLOW} when done viewing the list of files.\n${NC}" +read -p "Press any key to view the backup." + +tar -tzf ${BACKUP_FILE} | less +