#!/bin/sh # this is my /tmp cleaning script that runs every hour or so... cd /tmp || exit 1 { find . -mindepth 2 \ \( -type f -o -type l \) \ \( \ \( -name "*~" -amin +180 \) \ -o \( -mtime +14 -atime +14 \) \ \) \ \! \( -path .X11-unix -o -path .IROHA -o -path .ki2-unix \) \ -print0 | xargs -0r rm -f find . -mindepth 1 -maxdepth 1 \ \( -type f -o -type l \) \ -mtime +1 -atime +1 \ \! -name ".X*-lock" \ -print0 | xargs -0r rm -f find . -mindepth 1 -depth -type d -print0 | xargs -0r rmdir --ignore-fail-on-non-empty } >/dev/null 2>&1