Last active
November 8, 2019 14:41
-
-
Save daliborgogic/025ef949760c59eefeb36e6a32fa6168 to your computer and use it in GitHub Desktop.
I like to move it move it Google Cloud Bucket
This file contains hidden or 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 | |
# . ./backup-files.sh from to | |
# Variables | |
WHAT=`date +%d%m%y%H%M%S`.tar.gz | |
WHERE=gs://$2/$WHAT | |
SMALLER_ARE_BETTER="tar -czvf $WHAT $1" | |
targz(){ | |
echo "I like to move it move it..." | |
if $SMALLER_ARE_BETTER; then | |
echo "Ya like to (move it!) $WHAT" | |
return 0 | |
else | |
echo "Nose powder; 'pon ya face" | |
return 1 | |
fi | |
} | |
IliketoMoveItMoveIt() { | |
echo "I like to move it move it. I like to move it move it. I like to move it move it.,Ya like to (move it!)" | |
if /home/google-cloud-sdk/bin/gsutil -m cp -r $WHAT $WHERE; then | |
echo "Sweet fantastic $WHERE." | |
return 0 | |
else | |
echo "Nose powder; 'pon ya face" | |
return 1 | |
fi | |
} | |
if [ ! -z "$1" ]; then | |
if targz; then | |
IliketoMoveItMoveIt | |
fi | |
fi | |
echo "Keep this area clean. Your mother isn't here... Clean up after yourself." | |
rm -f ./$WHAT | |
echo "Cleaned $WHAT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment