|
|
|
@@ -1,33 +1,11 @@
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
MEGA_VOLUME="/Volumes/MEGA"
|
|
|
|
|
ELEMENTS="/Volumes/ELEMENTS"
|
|
|
|
|
MEGA="$HOME/MEGA"
|
|
|
|
|
STARTED="$HOME/.config/backup-started-$(date +%d-%m)"
|
|
|
|
|
|
|
|
|
|
function main() {
|
|
|
|
|
if [[ ! -e "$STARTED" ]]
|
|
|
|
|
then
|
|
|
|
|
echo -e "[LOG] $(date) Started $HOME/Documents/Collage/Semestr2 ->\
|
|
|
|
|
$MEGA/Documents/Collage/Semestr2"
|
|
|
|
|
rsync --bwlimit=2048 --update --progress -r \
|
|
|
|
|
--exclude '*.mp4' --exclude '*.mkv'\
|
|
|
|
|
--exclude '.debris' \
|
|
|
|
|
"$HOME/Documents/Collage/Semestr2/"\
|
|
|
|
|
"$MEGA/Documents/Collage/Semestr2/"
|
|
|
|
|
echo -e "[LOG] $(date) Ended $HOME/Documents/Collage/Semestr2 ->\
|
|
|
|
|
$MEGA/Documents/Collage/"
|
|
|
|
|
|
|
|
|
|
echo -e "[LOG] $(date) Started $HOME/Documents/Collage/Semestr2 ->\
|
|
|
|
|
$ELEMENTS/Collage/Semestr2"
|
|
|
|
|
rsync --bwlimit=2048 --update --progress -r \
|
|
|
|
|
--exclude '*.mp4' --exclude '*.mkv'\
|
|
|
|
|
--exclude '.debris' \
|
|
|
|
|
"$HOME/Documents/Collage/Semestr2/"\
|
|
|
|
|
"$ELEMENTS/Collage/Semestr2/"
|
|
|
|
|
echo -e "[LOG] $(date) Ended $HOME/Documents/Collage/Semestr2 ->\
|
|
|
|
|
$ELEMENTS/Documents/Collage/"
|
|
|
|
|
|
|
|
|
|
if [[ ! -e "$STARTED" ]]; then
|
|
|
|
|
touch "$STARTED" && echo -e "[LOG] $(date) Created the file $STARTED"
|
|
|
|
|
|
|
|
|
|
echo -e "[LOG] $(date) Started $HOME/.ssh/ -> $MEGA/ssh"
|
|
|
|
@@ -38,8 +16,7 @@ $ELEMENTS/Documents/Collage/"
|
|
|
|
|
rsync --bwlimit=2048 --update --progress -r "$HOME/.gnupg/" "$MEGA/gnupg/"
|
|
|
|
|
echo -e "[LOG] $(date) Finished $HOME/.gnupg/ -> $MEGA/gnupg"
|
|
|
|
|
|
|
|
|
|
if [[ -e "$MEGA_VOLUME" ]]
|
|
|
|
|
then
|
|
|
|
|
if [[ -e "$MEGA_VOLUME" ]]; then
|
|
|
|
|
echo -e "[LOG] $(date) Started $MEGA -> $MEGA_VOLUME"
|
|
|
|
|
rsync --bwlimit=2048 --update --progress -r --exclude '.DS_Store' \
|
|
|
|
|
--exclude '.debris' \
|
|
|
|
|