Search code examples
linuxcrongsutil

Linux : gsutil does not work in cron


I'm trying to upload files to Google Cloud Storage using cron in Linux, but it fails. I have also set path and configuration in my script file as :

PATH=/bin/gsutil/
export BOTO_CONFIG="/home/ashu/.boto"
# rest of script

But still nothing works.


Solution

  • I removed my pip install and used following link for installation : https://cloud.google.com/storage/docs/gsutil_install#specifications.

    Also use of sudo should be avoided for path and export as it can lead to some issues.

    PATH=$PATH:/root/gsutil/
    export BOTO_CONFIG="/root/.boto"
    # rest of script
    

    Above code works well.