Adding doctl auth init to the script the first go around worked perfectly.
Just installed DOCTL on my Raspberry Pi. I have performed doctl auth ini and verified my API Token.
Yet, when I run my script, I get the following:
Error: unable to initialize DigitalOcean api client: access token is...
Hi there @aaronmweiss,
It sounds like that your script might be running as a different user, for example you've authenticated as your default pi user but the script is executed as the root user.
I would recommend addi...
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><^>