Here are a few examples from this site.
01 * * * * root echo "This command is run at one min past every hour" 17 8 * * * root echo "This command is run daily at 8:17 am" 17 20 * * * root echo "This command is run daily at 8:17 pm" 00 4 * * 0 root echo "This command is run at 4 am every Sunday" * 4 * * Sun root echo "So is this" 42 4 1 * * root echo "This command is run 4:42 am every 1st of the month" 01 * 19 07 * root echo "This command is run hourly on the 19th of July"
Do a “crontab -e” on the shell. If you don’t have permission, try “sudo crontab -e”. It should open up Vi.
running php scripts on crontab, i do this:
0 8 * * * * /path/to/test.php >> /path/to/log.txt
anything that is outputted in test.php would be appended to log.txt
so if my script has:
echo date(‘Y-m-d H:i:s’).” hello worldn”;
the log.txt would have
2008-02-14 01:34:32 hello world