Skip to content

Instantly share code, notes, and snippets.

@nazroll
Last active October 13, 2022 21:20
Show Gist options
  • Save nazroll/fea293aa582506d7b1e7 to your computer and use it in GitHub Desktop.
Save nazroll/fea293aa582506d7b1e7 to your computer and use it in GitHub Desktop.
A shell script example to run "gsutil" as a cronjob
#! /bin/bash
# Replace "/path/to/gsutil/" with the path of your gsutil installation.
PATH="$PATH":/path/to/gsutil/
# Replace "/home/username/" with the path of your home directory in Linux/Mac.
# The ".boto" file contains the settings that helps you connect to Google Cloud Storage.
export BOTO_CONFIG="/home/username/.boto"
# A simple gsutil command that returns a list of files/folders in your bucket.
# Replace "yourbucketname" with a bucket name from your Google Cloud Storage.
# You can replace this line with your own gsutil command to upload a file, etc.
gsutil ls -l gs://yourbucketname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment