Compare commits

..

No commits in common. "cdbab4fe6a94f09373f268c7446afc976e29a452" and "e5dbc62354476525a1d89b8076b879de5b795f3d" have entirely different histories.

2 changed files with 46 additions and 24 deletions

View File

@ -1,35 +1,58 @@
#!/bin/bash #!/bin/bash
MEGA_VOLUME="/Volumes/MEGA" MEGA_VOLUME="/Volumes/MEGA"
ELEMENTS="/Volumes/ELEMENTS"
MEGA="$HOME/MEGA" MEGA="$HOME/MEGA"
STARTED="$HOME/.config/backup-started-$(date +%d-%m)" STARTED="$HOME/.config/backup-started-$(date +%d-%m)"
function main() { function main(){
if [[ ! -e "$STARTED" ]]; then if [[ ! -e "$STARTED" ]]
touch "$STARTED" && echo -e "[LOG] $(date) Created the file $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/.ssh/ -> $MEGA/ssh" echo -e "[LOG] $(date) Started $HOME/Documents/Collage/Semestr2 ->\
rsync --bwlimit=2048 --update --progress -r "$HOME/.ssh/" "$MEGA/ssh/" $ELEMENTS/Collage/Semestr2"
echo -e "[LOG] $(date) Finished $HOME/.ssh/ -> $MEGA/ssh" 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/"
echo -e "[LOG] $(date) Started $HOME/.gnupg/ -> $MEGA/gnupg" touch "$STARTED" && echo -e "[LOG] $(date) Created the file $STARTED"
rsync --bwlimit=2048 --update --progress -r "$HOME/.gnupg/" "$MEGA/gnupg/"
echo -e "[LOG] $(date) Finished $HOME/.gnupg/ -> $MEGA/gnupg"
if [[ -e "$MEGA_VOLUME" ]]; then echo -e "[LOG] $(date) Started $HOME/.ssh/ -> $MEGA/ssh"
echo -e "[LOG] $(date) Started $MEGA -> $MEGA_VOLUME" rsync --bwlimit=2048 --update --progress -r "$HOME/.ssh/" "$MEGA/ssh/"
rsync --bwlimit=2048 --update --progress -r --exclude '.DS_Store' \ echo -e "[LOG] $(date) Finished $HOME/.ssh/ -> $MEGA/ssh"
--exclude '.debris' \
--exclude 'Icon*' \
"$MEGA/" "$MEGA_VOLUME/"
else
echo -e "[ERROR] The folder $MEGA_VOLUME does NOT exist"
fi
echo -e "[LOG] $(date) Removed the files $STARTED and $STARTED *" echo -e "[LOG] $(date) Started $HOME/.gnupg/ -> $MEGA/gnupg"
rm -rf "$STARTED" rsync --bwlimit=2048 --update --progress -r "$HOME/.gnupg/" "$MEGA/gnupg/"
rm -rf "$HOME/.config/backup-started-*" echo -e "[LOG] $(date) Finished $HOME/.gnupg/ -> $MEGA/gnupg"
fi
if [[ -e "$MEGA_VOLUME" ]]
then
echo -e "[LOG] $(date) Started $MEGA -> $MEGA_VOLUME"
rsync --bwlimit=2048 --update --progress -r --exclude '.DS_Store' \
--exclude '.debris' \
--exclude 'Icon*' \
"$MEGA/" "$MEGA_VOLUME/"
else
echo -e "[ERROR] The folder $MEGA_VOLUME does NOT exist"
fi
echo -e "[LOG] $(date) Removed the files $STARTED and $STARTED *"
rm -rf "$STARTED"
rm -rf "$HOME/.config/backup-started-*"
fi
} }
main >"$HOME/.config/backup.log" main > "$HOME/.config/backup.log"

1
.zshrc
View File

@ -131,7 +131,6 @@ export HISTTIMEFORMAT="%F %T "
# Export for Mac # Export for Mac
if [[ "$(uname)" == "Darwin" ]]; then if [[ "$(uname)" == "Darwin" ]]; then
export PATH="/usr/local/opt/openssl@3/bin:$PATH" export PATH="/usr/local/opt/openssl@3/bin:$PATH"
export PATH=$PATH:$HOME/Library/Python/3.9/bin
export LDFLAGS="-L/usr/local/opt/openssl@3/lib" export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include" export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig" export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"