Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have this script so far:
#!/bin/bash
# script to create digitalocean droplet snapshot using their CLI, doctl.
# Function to set variable for snapshot name as date/time of creation.
timestamp() {
NAME=$(date)
}
timestamp
doctl compute droplet-action snapshot --snapshot-name "$NAME" 80750079
The script works with the result being a droplet snapshot with the date/time of creation as the name. However, I need to keep only 12 snapshots.
Somehow I need to count the number of existing snapshots and when I have 12, delete the oldest and add a new one.
How can I achieve that?
I run the script every two hours.
Any help would be greatly appreciated!
Thanks!
2b943a6c5830489f9a3a6e3ade857e
8c5b08bc277a4e1bbfbcdd305aa232
Kailey Ketchum
9c1989c1c80144c7a9977905ce64c9
a6309a057c3f4cb38fb2e7feb67236
a6309a057c3f4cb38fb2e7feb67236
9c1989c1c80144c7a9977905ce64c9
CometAPI001
Rafiq Mohammed shah
05f65dd4216b456c9c89745746f80e
erel