some blag

November 5, 2008

pacman’s cache strikes again

Filed under: Uncategorized — andrew @ 10:05 pm

~/.config/fsniper/scripts/pacman-cache.sh


#!/bin/bash
# This script checks the pacman cache directory and runs a command if it is over a certain size.
MAXSIZE="3500" # run the command you if the cache is over this size (in mb)
# run this command if CACHE is > MAXSIZE
COMMAND="echo \"oh no pacman's cache is over $MAXSIZE\" | mail -s \"pacman warning\" me@gmail.com "
CACHE="/var/cache/pacman/pkg" # cache location

if [[ "`du -sm $CACHE`" > "$MAXSIZE" ]]; then
$COMMAND
fi

and in ~/.config/fsniper/config

/var/cache/pacman/pkg/ {
* {
handler = pacman-cache.sh %%
}

Powered by WordPress