Skip to content

Instantly share code, notes, and snippets.

@dynnamitt
Last active November 16, 2016 07:59
Show Gist options
  • Save dynnamitt/c1f54402ff3efe734cb49ec49b87f6ec to your computer and use it in GitHub Desktop.
Save dynnamitt/c1f54402ff3efe734cb49ec49b87f6ec to your computer and use it in GitHub Desktop.
# bonus: sexy logfile ;)
sudo su
printf "#\!/usr/bin/env sh\n(date;docker rmi \$(docker images -q);echo +++++;) \
>> /var/log/docker_rmi_cron.log 2>&1\n" > /etc/cron.weekly/docker-rmi
chmod +x /etc/cron.weekly/docker-rmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment