Script to run commands at a specific time.

Hello All,

I have written a script which which is working fine to a certain logic of it. But i want a part of the script to run two commands at 00:10 hrs every day. These two command are

1. rm -rf /path/to/folder
2. mail the content of a file.

How do i achieve this. Thanks.

-Siddhesh

man crontab
crontab -e

use this command to set the time and commands, you can refer to the manual to get the rules. This command automatically uses a simple editor for user to implement settings. After your saving the contents. so, finished
you can set the first 5 fields which represent time set with "* * * * *" to see whether commands work or not. This might be the shortest time quantum.

Well i wish to include these in script itself....how do i do that?

I am trying to use this, but it does not work. is there anything wrong in this?

hr=`date +%H%M`
if test $hr -gt 0010 -a $hr -lt 0001
then
echo ====zoomdat=== >> $LOG_DATA_FINAL
fi
hr=$( date +"%H" )
mi=$( date +"%M" )

if [ $hr -eq 00 ] && [ $mi -ge 00 ] && [ $mi -le 10 ] # 00:00 - 00:10
then
        echo ====zoomdat===
fi