you will be better off creating a script that is run by cron every 3 hours.
firstly create your script, i choose root's own home folder (remember to back it up)
and set permissions to enable execution
the commands below are done as 'root' to ensure that files can be deleted (remember that these commands will run as root so it can cause damage if you do not know what/when you are deleting)
Code:
touch /root/scripts/clear_myFolder
chmod +x /root/scripts/clear_myFolder
then add the command required to be run.
when you say 'delete all files'
do you want to leave the directory structure intact?
if you want to keep the structure, you can amend this code snippet:
http://www.brainpowered.net/cms/cont...l-bash-snipets
into something like this:
Code:
find <PATH TO ROOT FOLDER> -type f -print | while read i; do rm $FILE; done
or, if you just want to delete everything in that folder
Code:
rm -R <PATH TO ROOT FOLDER>/*
note the '/*'
that will preserve your folder but delete everything inside it.
so your script has something like:
Code:
#!/bin/bash
# comment - cleaning my folder (or use the other snippet
rm -R <PATH TO ROOT FOLDER>/*
then create a crontab entry to run this script whenever you wish, see:
http://crontab.org/
http://corenominal.org/howto-setup-a-crontab-file/
Code:
crontab -e
* */3 * * * /root/scripts/clear_myFolder
if you find confusing to setup crontab (i do) look at something like this:
http://www.corntab.com/pages/crontab-gui
you can just as well replace the path to your script with the actual command - but having the command outside the crontab gives you more flexibility - in my humble opnion.
hope this helps