Skip to content

Instantly share code, notes, and snippets.

@chasebolt
chasebolt / install_eon_purge_data.sh
Last active July 8, 2019 22:50 — forked from tentious/install_deletion_job.sh
installs EON cron job that automatically purges oldest video when used space is greater than the MAX_USED_PERCENT limit
#!/bin/env bash
set -e
# install via curl
# curl -sL https://gist.github.com/chasebolt/fd5210b4c2a44a2b0db383162a66632c/raw/install_eon_purge_data.sh | bash
# create purge script
mkdir -p /data/local
cat <<'EOF' > /data/local/purge-data.sh
#!/bin/sh
Chef::Resource::DockerContainer.class_eval do
property :dependencies_updated, [true, false]
def depends_on(resource)
subscribes :dependencies_updated, resource, :immediately
subscribes :run, resource
end
action :dependencies_updated do
new_resource.dependencies_updated true