aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/purge-old-pastes.sh
blob: 32997286d7167e14b7be383f76ec650d7c3f2115 (plain)
1
2
3
4
5
6
7
8
9
#!/bin/sh

# 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 {} \;