From 0453b2257e6ea3f6028a1aeec74a8e12c440eb9b Mon Sep 17 00:00:00 2001 From: VG Date: Mon, 6 Jun 2016 11:22:41 +0200 Subject: Fix purge script to be able to import config to be able to do 'import config' in python we have to be in the containing directory (or set pythonpath for example). to adapt the script to your environment simply change the cd /pasteme line. --- scripts/purge-old-pastes.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/purge-old-pastes.sh b/scripts/purge-old-pastes.sh index a22ded8..3299728 100755 --- a/scripts/purge-old-pastes.sh +++ b/scripts/purge-old-pastes.sh @@ -3,6 +3,7 @@ # This script is intend to be run as a cron job (every day for ex) to purge # old pastes. +cd /pasteme 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