Cron Jobs, in simplest terms, are jobs set to execute at a specific time. These "jobs" are actually scripts written in PHP, Perl, BASH, etc. Any script that can be run from the command line, can be scheduled to run automatically at a specific time by creating a Cron Job.
Cron Jobs are created via the Shell (or command line), so only 1&1 packages with SSH access are able create Cron Jobs.
He records the audio, uploads it and waits. All of a sudden he worries that with the building traffic he has been receiving, perhaps the 1&1 server he is using may not be able to accommodate many users downloading a large audio file. John is a wiz at programming so he quickly writes a BASH script to check his web server logs for failed file transfers to gather more info about his suspicion. He saves the script as failedXferCheck.sh. He runs the failedXferCheck.sh script he just made from the command line to find out that a few file transfers have failed. This worries him, so he decides to create a Cron Job that will run this script at 7 am the next morning and 7 am every morning after to keep an eye on things for a while. He alters the script slightly so that he is e-mailed the results. Since he checks his E-mail every morning while drinking his coffee, he will be able to quickly check the results before getting started on work for that day.
|1st Part||2nd Part||3rd Part|
|0 7 * * *||/usr/bin_uk/bash||/homepages/11/d123456789/htdocs/motivationSite/cron/failedXferCheck.sh|
The Schedule specifies when or how often the script should be run. This can be any number of options from once every hour, on the hour to 8:35 am on Sundays to 15 minutes after the hour, every other hour, on the 21st-28th of each month. As you can see, the scheduling can become quite complex.
The schedule format is as below:
|Schedule Field||Minute||Hour||Day of Month||Month||Day of Week|
|Explanation||0 minutes past the hour||of the 7th hour (24hr time)||every day||of every month||every day of the week (Sun-Sat)|
An asterisk(*) signifies every option. Using the example above you will notice that the script John Smith is running is set to execute at 7 am every single day.
The Executable is the application that should run the process. This is not actually required by the Cron Job as the system should automatically run the script with the correct application according to its extension (so that .php file are run using PHP and .sh files are run using BASH) however it is best to specify.
The script is the file that contains the code to be executed. This code can be PHP, Perl, Python, BASH, etc. Using the full folder path to the file is necessary. Using only the filename without the folder path will likely result in errors.
Using this information, you should now have a general understanding of Cron Jobs.