Last active
July 17, 2019 08:46
-
-
Save marianmirzacu/93b3478dc0446e5804c4e3298ba57939 to your computer and use it in GitHub Desktop.
archive and upload to onedrive (or other cloud storage) my work folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOME=/mnt/e/work | |
DIRS=`ls $HOME` | |
TIMESTAMP=$(date +"%F") | |
for dir in $DIRS;do | |
echo "START backup $dir" | |
zip -rq "$HOME"/"$dir".zip "$HOME"/"$dir"/* | |
echo "START transfer $dir" | |
rclone copy "$HOME"/"$dir".zip onedrive:backup/personal/home/work/"$TIMESTAMP" --config="/home/USERNAME/.config/rclone/rclone.conf" | |
rm "$HOME"/"$dir".zip | |
done | |
echo "ALL DONE!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment