madaboutlinux

Well-Known Member
Jan 24, 2005
1,051
2
168
Earth
Create a file say, 'deltempfiles' under any directory and insert the following lines :-

#!/bin/bash

cd /tmp;
rm -f p*.*;

Save the file and chmod it to 755.

Edit the cron file for root at /var/spool/cron/root or just do crontab -e

and set the cron as :-

5 * * * * /Path/to/deltempfiles

Save the file and restart cron service :- service crond restart