Hi guys
I thought this could be useful for you. As you know cron is very useful to automatically execute any operation on a specific time or an interval of time. In Windows, it is basically known as Windows Scheduler. In Linux Environment, it is known as Cron. Cron is basically installed in servers and we can manage the cron from the server's control panel. But there are some convention of using the cron. There is a file called crontab in the server which contains all the commands that will be executed. As i said, if we have the control panel with cron installed with it, we can do the cron operation. But if we dont have any access to that control panel, then we can easily do it by using some php code that will execute a cron command and a task that needs to be performed.
But before that, i want to give you an idea about the command that is needed to perform a task in a given time.
There is a special format for entering cron command:
Minute Hour Day Month Day Task
Minute = Minute of the hour, 00 to 59. * Will indicate every minute (details later)
Hour = Hour of the day in 24-hour format, 00 to 23. * Will indicate every hour (details later)
Day = Day of the month, 1 to 31. * Will indicate every day (details later)
Month = Month of the year, 1 to 12. * Will indicate every month (details later)
Day = Day of the week, 3 chars - sun, mon, tue, or numeric (0=sun, 1=mon etc).... * Will indicate every day (details later)
Task = The command you want to execute
Note: each of the above must be separated by at least 1 space.
So this is the format to write the cron command in the crontab file.
For more study about cron jobs, go to google.com and start exploring.
Cheers!!!!
Sabbir
No comments:
Post a Comment