Skip to content

Instantly share code, notes, and snippets.

@randombenj
Created June 15, 2020 11:42
Show Gist options
  • Save randombenj/d42abf39a15739166fddcb53916e5a0c to your computer and use it in GitHub Desktop.
Save randombenj/d42abf39a15739166fddcb53916e5a0c to your computer and use it in GitHub Desktop.
#!/bin/sh
lxc image rm $( \
lxc image list --format=json | \
jq -r --arg s $( \
date -d "-1 month" +%Y-%m-%d \
) '[map(select(.created_at | . <= $s)) | .[].fingerprint] | join(" ")')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment