'How to assign gsutil path to a variable
I'm writing a script to automate db backup. For gsutil to work on bash script, you need to give a full path e.g; /home/user/google-cloud-sdk-358.0.0-linux-x86_64/google-cloud-sdk/bin/gsutil cp ....
Now I want to set the value of which gsutil to a var but it prints blank line. I suspect it the characters that form the path. This was the expected output (/home/user/google-cloud-sdk-358.0.0-linux-x86_64/google-cloud-sdk/bin/gsutil)
Also: Suggestion to the best approach of doing periodic backup of db from gcloud vm to storage bucket is welcomed.
g_util=$(which gsutil)
pw=$(pwd)
g_s=$(which gs)
echo $g_util #prints a blank line
echo $g_s
echo $pwd
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
