Skip to content

Instantly share code, notes, and snippets.

@ThomasWunderlich
Created February 3, 2013 04:45
Show Gist options
  • Save ThomasWunderlich/4700571 to your computer and use it in GitHub Desktop.
Save ThomasWunderlich/4700571 to your computer and use it in GitHub Desktop.
So you want to use gsutil in your crons but running into problems? Here's the solution:
The most likely reason is that cron runs in a very limited environment and doesn't have access to gsutil or to gsutil's configuration.To fix this you should set your Path variable and the gsutil configuration inside your script like so:
#!/bin/bash
PATH=path/to/gsutil
export BOTO_CONFIG="/path/to/.boto"
#rest of script here
To get the Path type these commands in your shell
echo $PATH
gsutil -D ls 2>&1 | grep config_file_list
Then just copy those to your path/to/gsutil and export BOTO_CONFIG lines
@EmmanuelSotelo
Copy link

Thanks.

@kamalbanga
Copy link

Thanks 😄. Very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment