Skip to content

Instantly share code, notes, and snippets.

@dansku
Created March 28, 2016 17:03
Show Gist options
  • Select an option

  • Save dansku/5488a229e6b957da6974 to your computer and use it in GitHub Desktop.

Select an option

Save dansku/5488a229e6b957da6974 to your computer and use it in GitHub Desktop.
#!/bin/bash
#today variable as YYYY-MM-DD
NOW=$(date +"%Y-%m-%d")
#Upload all files to our dated folder in the selected bucket
gsutil cp /home/backups/files/* gs://bucket-name/$NOW
#Delete all the files after uploading them
rm /home/backups/files/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment