Re: Manual Volume Snapshot retention

2016-11-17 Thread Dag Sonstebo
Hi Alessandro, Sorry forgot to say this requires you to set CloudMonkey to display json. If CloudMonkey display is set to “default” you will get parse error. Either: In your //.cloudmonkey/config file set the following: [ui] display = json Or do this from command line: # cloudmonkey

Re: Manual Volume Snapshot retention

2016-11-17 Thread Alessandro Caviglione
Hi Dag, thank you very much, I didn't know jq! But with your command I get this error: parse error: Invalid numeric literal at line 1, column 6 I search on Google and I see that it could be a problem of missing double quote in the json array... but it's strange because it's not a file but an API

Re: Manual Volume Snapshot retention

2016-11-14 Thread Özhan Rüzgar Karaman
Hi Dag; Jq looks great it really eliminates lots of long lines of codes in my bash scripts for json parsing. Thanks for sharing this useful tool with us. Thanks Özhan On Fri, Nov 11, 2016 at 5:48 PM, Dag Sonstebo wrote: > Hi Alessandro, > > “Jq” is your friend here.

Re: Manual Volume Snapshot retention

2016-11-11 Thread Dag Sonstebo
Hi Alessandro, “Jq” is your friend here. You would start by just listing all the volume snapshot ordered by create time – whilst also capturing the snapshot ID: # cloudmonkey list snapshots volumeid=21f830d8-b182-41dc-8a10-48ff0a07f299 | jq -r '.snapshot[] | .created + "|" + .id' | sort -r

Manual Volume Snapshot retention

2016-11-11 Thread Alessandro Caviglione
Hi guys, I've a Cloudmonkey script under cron that create a Volume Snapshot of a VPS at certain hours. I had to create this script because client wants to have more than one Snapshotfor each day, so through GUI this is not possible. Now, could someone help me to delete old Snapshot in the scripts?