I have written a bash script that uses gcloud command to activate service account and gsutil command to move files to GCS bucket. When I run the script using bash command, it executes well.But when I place the script in crontab , it fails with command not found.
==> NOTE: You are uploading one or more large file(s), which would run
significantly faster if you enable parallel composite uploads. This
feature can be enabled by editing the
"parallel_composite_upload_threshold" value in your .boto
configuration file. However, note that if you do this large files will
be uploaded as `composite objects
<https://cloud.google.com/storage/docs/composite-objects>`_,which
means that any user who downloads such objects will need to have a
compiled crcmod installed (see "gsutil help crcmod"). This is because
without a compiled crcmod, computing checksums on composite objects is
so slow that gsutil disables downloads of composite objects.
Removing file:///file.csv
Operation completed over 1 objects/2.7 GiB.
/script.sh: line 691: gcloud: command not found
/script.sh: line 693: gsutil: command not found
What is the mistake here. How do I correct it
PATHcontaining only /bin and /usr/bin, so if they're anywhere else (and you don't add the relevant directory toPATH), they won't be found. See "crontab and binaries in /usr/local/bin" and if that doesn't solve it, "CronJob not running" has more troubleshooting recommendations.