Skip to content

Instantly share code, notes, and snippets.

@dakkar
Created January 9, 2012 14:29
Show Gist options
  • Save dakkar/1583171 to your computer and use it in GitHub Desktop.
Save dakkar/1583171 to your computer and use it in GitHub Desktop.
cronjob to clean spamdyke graylisting dir
#!/bin/bash
CONF=/etc/spamdyke/spamdyke.conf
graylist_dir=$(grep graylist-dir "$CONF");graylist_dir=${graylist_dir##*=}
graylist_max_secs=$(grep graylist-max-secs "$CONF");graylist_max_secs=${graylist_max_secs##*=}
find ${graylist_dir} -type f -mmin +$[ ${graylist_max_secs} / 60 ] -print0 | xargs -0 rm -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment