Skip to content

Instantly share code, notes, and snippets.

@daliborgogic
Last active November 8, 2019 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daliborgogic/025ef949760c59eefeb36e6a32fa6168 to your computer and use it in GitHub Desktop.
Save daliborgogic/025ef949760c59eefeb36e6a32fa6168 to your computer and use it in GitHub Desktop.
I like to move it move it Google Cloud Bucket
#!/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