aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2016-06-06 11:22:41 +0200
committerVG <vg@devys.org>2016-06-06 11:22:41 +0200
commit0453b2257e6ea3f6028a1aeec74a8e12c440eb9b (patch)
tree0458b167137c14904f99358615c8dfd6700518da
parent1831e5d4cf6c330dd57483052b44e82508277c66 (diff)
downloadpasteme-0453b2257e6ea3f6028a1aeec74a8e12c440eb9b.tar.gz
pasteme-0453b2257e6ea3f6028a1aeec74a8e12c440eb9b.tar.bz2
pasteme-0453b2257e6ea3f6028a1aeec74a8e12c440eb9b.zip
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.
-rwxr-xr-xscripts/purge-old-pastes.sh1
1 files changed, 1 insertions, 0 deletions
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 {} \;