find /data/folder -type f -uid 400 -atime +2 -exec /bin/rm {} ;
find /data/folder -type d -uid 400 -atime +2 | sort -r | /usr/bin/perl -e 'foreach (<>) {chop; rmdir;
Tags: crontab, find, perl, sort
Posted by Hans-Henry Jakobsen
On a few recent occasions, I have had to catch and fix runaway CPU-hog zombie processes. Usually, I notice these after a being frustrated for a period of time by slow machine response times. Using the w command in a terminal shows that my CPU load is too high, but I often don’t think to check that first. Wouldn’t it be great to set up an ambient visual alert, to warn of such system issues in a non-intrusive manner? This is easy with a combination of cron, perl, and a desktop picture set to change every minute.
(more…)
Posted by Hans-Henry Jakobsen