linuxShortcuts/Backup/.Backup_HD_1TB.sh

60 lines
2.0 KiB
Bash
Raw Normal View History

YEARMONTH=`date +%Y/%m-%b`
YEAR=`date +%Y`
HDPath="/run/media/bruno/Seagate\ Expansion\ Drive"
HDYEARMONTH="$HDPath/$YEARMONTH"
2018-08-09 02:56:17 +00:00
White="\e[97m"
Gray="\e[39m"
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"
2018-08-03 15:37:03 +00:00
backup="rsync -rptgoDql --exclude-from=./exclude"
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
2018-08-09 02:56:17 +00:00
echo -e "$White`date +%r` - Copying Dropbox folder (1/7)...$Gray"
eval $backup "/run/media/bruno/Multimedia/Dropbox" "$HDYEARMONTH/Multimedia/" || echo ""
2018-08-09 02:56:17 +00:00
echo -e "$White`date +%r` - Copying Linux Home folder (2/7)...$Gray"
2018-08-09 02:56:17 +00:00
echo -e "$White `date +%r` - Bruno$Gray"
eval $backup "/home/bruno/" "$HDYEARMONTH/LinuxHome/bruno/" || echo ""
2018-08-09 02:56:17 +00:00
echo -e "$White `date +%r` - Admin$Gray"
eval $backup "/home/admin/" "$HDYEARMONTH/LinuxHome/admin/" || echo ""
2018-08-09 02:56:17 +00:00
echo -e "$White`date +%r` - Copying Localização folder (3/7)...$Gray"
eval $backup "/run/media/bruno/Multimedia/Localização" "$HDYEARMONTH/Multimedia/" || echo ""
2018-08-09 02:56:17 +00:00
echo -e "$White`date +%r` - Copying My Documents folder (4/7)...$Gray"
eval $backup "/run/media/bruno/Multimedia/My\ Documents" "$HDYEARMONTH/Multimedia/" || echo ""
2018-08-09 02:56:17 +00:00
echo -e "$White`date +%r` - Copying Música folder (5/7)...$Gray"
eval $backup "/run/media/bruno/Multimedia/Música" "$HDYEARMONTH/Multimedia/" || echo ""
2018-08-09 02:56:17 +00:00
echo -e "$White`date +%r` - Copying Fotos folder (6/7)...$Gray"
eval $backup "/run/media/bruno/Multimedia/Fotos" "$HDPath/$YEAR/" || echo ""
2018-08-09 02:56:17 +00:00
echo -e "$White`date +%r` - Copying Virtual Machines folder (7/7)...$Gray"
eval $backup "/run/media/bruno/Multimedia/Virtual\ Machines" "$HDPath/$YEAR/" || echo ""
2018-08-09 02:56:17 +00:00
echo -e "$White`date +%r` - Backup finished. Please, verify your log files.$Gray"
kdialog --title "Backup Complete" --msgbox "Backup finished successfully"
echo
echo Press enter key to close
read