I'm looking to develop a script where the Snapshot list is emailed to someone.
When I run doctl compute droplet snapshots $dropletid, I get the following:
ID Name Type ...
When I run the following manually via the command line, it work beautifully.
However, when I run this same script via sudo crontab, it just deletes everything. What could I be doing wrong:
Assumption: There are 10 sn...
Have you allowed the sudo /snap/bin/doctl command to be executed without a password? You could do that by editing your sudoers file with the visudo command and adding something like:
<^>your_user<^> host = (ro...
The for loop asb was helpful for my needs.
I'm building a script that automatically will shutdown a droplet before it creates a snapshot, and then powers it back on.
The snapshot takes time to complete, but I think it would be great to see progress indicator. ...
When scripting with doctl you can pass the --wait flag to Droplet "action" commands in order to block until the action has completed. For example:
doctl compute droplet-action power-off --wait <^><droplet-id><^>