Cron is less known but almost universally present feature on any kind of server with an usual control panel.One can perform works via Cron without Shell Access. Those who have very good grasp on UNIX, uses this nifty Cron program to execute commands or scripts automatically at a specified time/date, like taking a backup. Unlike the CLI, which is absent in most Shared servers, some VPS, special Cloud Hosting Platforms, Cron is typically present in most web hosting control panels.
What is this Cron ?
Cron is a program that needs to be installed on the server to use the feature. Cron is a job control program mainly developed for UNIX or UNIX like operating systems including Linux, BSD, Mac OS X . Cron job is automatically set work via scripting which will run at a specified time.
Cron is not necessarily only for UNIX OS, there is Cron for Windows too.
How Cron and Cron Job are done
There is usually a button to set cron from control panel, its like this for Rackspace Control panel :
It depends on the server setup, which programing language cron will support, user have to write the script in text editor, name it with specific extension, like .sh extension and select other parameters :Advertisement
In other words, instead of normal execution of the script, which might be impossible without command line interface, or may be pathetic (like repeated works), user can set it via control panel, but the scripting must have to be done and uploaded via (S)FTP. The path will be Linux path, like
/mnt/servername/user/website folder/<span style="color: #ff0000;">itishere/script.sh</span>
Usually the red colored path is needed to be added as the control panel can detect and append the rest.
Example of cron to extract and compress
Typical example is :
tar -cvzf /DESTINATION/DIRECTORY/file.tar.gz /SOURCE/DIRECTORY/
In the same way, we can uncompress the tarball. This is written in Perl. So, the user need to write the correct path names in a text editor and save it as Perl script (not text file) otherwise Cron will not work.