From 05304a57ca5894431e8eb65f437240fea28c074d Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Fri, 3 Aug 2018 11:54:24 -0300 Subject: [PATCH] Including my Backup Script It needs work. Just created it to be able to backup things quickly. --- Backup/.Backup_HD_1TB.sh | 60 ++++++++++++++++++++++++++++++++++++++++ Backup/runBackup.sh | 2 ++ 2 files changed, 62 insertions(+) create mode 100755 Backup/.Backup_HD_1TB.sh create mode 100755 Backup/runBackup.sh diff --git a/Backup/.Backup_HD_1TB.sh b/Backup/.Backup_HD_1TB.sh new file mode 100755 index 0000000..3142019 --- /dev/null +++ b/Backup/.Backup_HD_1TB.sh @@ -0,0 +1,60 @@ +YEARMONTH=`date +%Y/%m-%b` +YEAR=`date +%Y` +HDPath="/run/media/bruno/Seagate\ Expansion\ Drive" +HDYEARMONTH="$HDPath/$YEARMONTH" + +mkdir -p "$HDPath/$YEAR" +mkdir -p "$HDYEARMONTH" +mkdir -p "$HDYEARMONTH/LinuxHome" +mkdir -p "$HDYEARMONTH/LinuxHome/bruno" +mkdir -p "$HDYEARMONTH/LinuxHome/admin" +mkdir -p "$HDYEARMONTH/LinuxHome/lost+found" + +backup="rsync -rptgoDql" + +echo +echo "Backup command : $backup" +echo "HD Backup path : $HDPath" +echo "HD Year-Month path: $HDYEARMONTH" +echo +echo Press enter key to start the backup +read +echo + +echo -e "\e[97m`date +%r` - Copying Dropbox folder (1/7)...\e[39m" +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 "\e[97m `date +%r` - Bruno\e[39m" +eval $backup "/home/bruno/" "$HDYEARMONTH/LinuxHome/bruno/" || echo "" + +echo -e "\e[97m `date +%r` - Admin\e[39m" +eval $backup "/home/admin/" "$HDYEARMONTH/LinuxHome/admin/" || echo "" + +echo -e "\e[97m `date +%r` - Lost+Found\e[39m" +eval $backup "/home/lost+found/" "$HDYEARMONTH/LinuxHome/lost+found/" || echo "" + +echo -e "\e[97m`date +%r` - Copying Localização folder (3/7)...\e[39m" +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" +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" +eval $backup "/run/media/bruno/Multimedia/Música" "$HDYEARMONTH/Multimedia/" || echo "" + +echo -e "\e[97m`date +%r` - Copying Fotos folder (6/7)...\e[39m" +eval $backup "/run/media/bruno/Multimedia/Fotos" "$HDPath/$YEAR/" || echo "" + +echo -e "\e[97m`date +%r` - Copying Virtual Machines folder (7/7)...\e[39m" +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" + +kdialog --title "Backup Complete" --msgbox "Backup finished successfully" + +echo +echo Press enter key to close +read + diff --git a/Backup/runBackup.sh b/Backup/runBackup.sh new file mode 100755 index 0000000..9d10a24 --- /dev/null +++ b/Backup/runBackup.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +terminator -m -T BACKUP -x systemd-inhibit sudo bash .Backup_HD_1TB.sh