Wednesday, February 18, 2009

Remove temporary files from /tmp directory

p.mapper creates various temporary files under the directory specified in the map file at WEB - IMAGEPATH

to remove them automatically add a shell script file rm_tempfiles under /etc/cron.daily that contains the following lines:

#!/bin/sh
find /home/www/tmp -name "*.png" -amin +60 -exec rm -f {} \;
find /home/www/tmp -name "*.jp*" -amin +60 -exec rm -f {} \;
find /home/www/tmp -name "*.tif" -amin +60 -exec rm -f {} \;
find /home/www/tmp -name "*.zip" -amin +300 -exec rm -f {} \;
find /home/www/tmp -name "*.tar" -amin +300 -exec rm -f {} \;
find /home/www/tmp -name "*.tmp" -amin +300 -exec rm -f {} \;
find /home/www/tmp -name "*.pdf" -amin +300 -exec rm -f {} \;
find /home/www/tmp -name "*.xls" -amin +300 -exec rm -f {} \;
find /home/www/tmp -name "sess_*" -amin +300 -exec rm -f {} \;

and set the file executable

~# chmod 755 rm_tempfiles

No comments:

Post a Comment

Followers