Skip to content

Instantly share code, notes, and snippets.

@ValentaTomas
Created May 9, 2021 13:15
Show Gist options
  • Save ValentaTomas/ea63c4df4f7645add22f2687e86d35a8 to your computer and use it in GitHub Desktop.
Save ValentaTomas/ea63c4df4f7645add22f2687e86d35a8 to your computer and use it in GitHub Desktop.
Upload files in a directory to GCP bucket without caching
#!/bin/sh
DIR=$1
export BUCKET=$2
cd $DIR
ls -l ./ | tr -s ' ' | cut -d' ' -f9 |
tr ' ' '\n' |
xargs -n 1 -I{} gsutil -h "Cache-Control:no-cache, max-age=0" cp {} gs://$BUCKET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment