From 394ad3a32cd37ec96641f63492cc5065c7210e17 Mon Sep 17 00:00:00 2001 From: VG Date: Sat, 29 Nov 2014 18:23:29 +0100 Subject: add cron script to purge old pastes --- scripts/config.py | 1 + scripts/purge-old-pastes.sh | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 120000 scripts/config.py create mode 100755 scripts/purge-old-pastes.sh (limited to 'scripts') diff --git a/scripts/config.py b/scripts/config.py new file mode 120000 index 0000000..3721332 --- /dev/null +++ b/scripts/config.py @@ -0,0 +1 @@ +../config.py \ No newline at end of file diff --git a/scripts/purge-old-pastes.sh b/scripts/purge-old-pastes.sh new file mode 100755 index 0000000..a22ded8 --- /dev/null +++ b/scripts/purge-old-pastes.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# This script is intend to be run as a cron job (every day for ex) to purge +# old pastes. + +pastedir="$(python3 -c 'import config; print(config.pastedir)')" +timeout="$(python3 -c 'import config; print(config.timeout)')" +find "$pastedir" -type f -mtime +"$timeout" -exec rm {} \; -- cgit v1.2.3