From ae915eef3834c77581bfb4374a6670340c6eb612 Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Wed, 8 Aug 2018 23:56:17 -0300 Subject: [PATCH] Improving backup script --- Backup/.Backup_HD_1TB.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Backup/.Backup_HD_1TB.sh b/Backup/.Backup_HD_1TB.sh index c27dcf2..a93a742 100755 --- a/Backup/.Backup_HD_1TB.sh +++ b/Backup/.Backup_HD_1TB.sh @@ -3,6 +3,9 @@ YEAR=`date +%Y` HDPath="/run/media/bruno/Seagate\ Expansion\ Drive" HDYEARMONTH="$HDPath/$YEARMONTH" +White="\e[97m" +Gray="\e[39m" + mkdir -p "$HDPath/$YEAR" mkdir -p "$HDYEARMONTH" mkdir -p "$HDYEARMONTH/LinuxHome" @@ -20,34 +23,33 @@ echo echo Press enter key to start the backup read echo - -echo -e "\e[97m`date +%r` - Copying Dropbox folder (1/7)...\e[39m" +echo -e "$White`date +%r` - Copying Dropbox folder (1/7)...$Gray" eval $backup "/run/media/bruno/Multimedia/Dropbox" "$HDYEARMONTH/Multimedia/" || echo "" -echo -e "\e[97m`date +%r` - Copying Linux Home folder (2/7)...\e[39m" +echo -e "$White`date +%r` - Copying Linux Home folder (2/7)...$Gray" -echo -e "\e[97m `date +%r` - Bruno\e[39m" +echo -e "$White `date +%r` - Bruno$Gray" eval $backup "/home/bruno/" "$HDYEARMONTH/LinuxHome/bruno/" || echo "" -echo -e "\e[97m `date +%r` - Admin\e[39m" +echo -e "$White `date +%r` - Admin$Gray" eval $backup "/home/admin/" "$HDYEARMONTH/LinuxHome/admin/" || echo "" -echo -e "\e[97m`date +%r` - Copying Localização folder (3/7)...\e[39m" +echo -e "$White`date +%r` - Copying Localização folder (3/7)...$Gray" eval $backup "/run/media/bruno/Multimedia/Localização" "$HDYEARMONTH/Multimedia/" || echo "" -echo -e "\e[97m`date +%r` - Copying My Documents folder (4/7)...\e[39m" +echo -e "$White`date +%r` - Copying My Documents folder (4/7)...$Gray" eval $backup "/run/media/bruno/Multimedia/My\ Documents" "$HDYEARMONTH/Multimedia/" || echo "" -echo -e "\e[97m`date +%r` - Copying Música folder (5/7)...\e[39m" +echo -e "$White`date +%r` - Copying Música folder (5/7)...$Gray" eval $backup "/run/media/bruno/Multimedia/Música" "$HDYEARMONTH/Multimedia/" || echo "" -echo -e "\e[97m`date +%r` - Copying Fotos folder (6/7)...\e[39m" +echo -e "$White`date +%r` - Copying Fotos folder (6/7)...$Gray" eval $backup "/run/media/bruno/Multimedia/Fotos" "$HDPath/$YEAR/" || echo "" -echo -e "\e[97m`date +%r` - Copying Virtual Machines folder (7/7)...\e[39m" +echo -e "$White`date +%r` - Copying Virtual Machines folder (7/7)...$Gray" eval $backup "/run/media/bruno/Multimedia/Virtual\ Machines" "$HDPath/$YEAR/" || echo "" -echo -e "\e[97m`date +%r` - Backup finished. Please, verify your log files.\e[39m" +echo -e "$White`date +%r` - Backup finished. Please, verify your log files.$Gray" kdialog --title "Backup Complete" --msgbox "Backup finished successfully"