CronJobs Defined
Cron is a time-primarily based job scheduler in Unix or Unix-like computer working systems. You should use Cron to schedule jobs, i.e. to execute commands or shell scripts at specified occasions, dates, or intervals. This permits you, for instance, to automate system maintenance or administration, to download files from the internet, or to send emails on a daily basis. It is a daemon, i.e. a background process that always runs on the server. The tasks cron schedule is supposed to perform are called CronJobs. Initially, the name Cron comes from the Greek god of time "chronos".
Application of CronJobs
CronJobs can be used for single commands or for the automated execution of periodically recurring sequential tasks, e.g. for cleaning up databases by removing obsolete entries, log files, and feedback, or for creating common statistics on the number of users of a website.
Other applications embody updating RSS feeds, publishing new content to a website on a selected date, generating multiple invoices, or automated newsletter distribution. Likewise, the backup of a database can be scheduled using CronJobs.
Construction and syntax of a CronTab file
Cron makes use of special configuration files, so-called CronTab files, which contain a list of cron jobs to be executed. CronTab stands for Cron Table. Each line within the CronTab file represents a CronJob. It looks just like a row of columns separated by a space. Every line specifies when and how usually a particular command or script ought to be executed.
In a CronTab file, empty lines or lines beginning with , spaces, or tabs are ignored. Lines starting with are considered user comments.
Active lines in a CronTab either declare an environment variable or define a CronJob. Comments are not allowed in active lines.
The CronTab file may be accessed in a command-line interpreter by typing "crontab-e". The commands in the CronTab file and their runtime are checked by the Cron daemon, which executes them in the system background.
The first 5 columns include time values which define when a command needs to be executed. These are, from left to proper:
Minute, specified as zero - 59
Hour, specified as zero - 23
Day, specified as 1 - 31
Month, specified as 1 - 12
Weekday, specified as 0 - 7, zero or 7 are Sundays
For every of these values, the wildcard "*" can be used for execution at any time (i.e. at any minute, hour, day, month or weekday), "*/n" for execution every n (minutes, hours, etc.) and "n,x,y" for execution on / at n, x or y. The last column specifies the relative or absolute path of the script to be executed. The CronJob is performed when the minute, hour, month, and day of the month or weekday match the current time.
Significance for on-line marketing
With CronJobs, you can automate varied tasks in on-line marketing, thus growing efficiency. In addition to automating time-consuming tasks, CronJobs can be utilized, for instance, to create visitor statistics for a website and automatically send these to a recipient at sure intervals. In conjunction with CMS, CronJobs can be utilized to automatically calculate metrics or send newsletters on specific dates as part of marketing campaigns.