Setting and configuring Cron jobs

In order to setup/edit your crontab you'll need to make a SSH connection first.
This example tutorial will help you to setup SSH connection with PuTTY terminal program.

1. PuTTY setup

Download putty.

Once download is completed, run putty and setup it with your webenabled SSH application access.

For example, if your application site name is http://acme.dev3.webenabled.net and
shell login is w_acme ,
then enter the following:

image

Now you're ready to process with the ssh session.

image

image

image

image

image

The following 3 steps are optional, but it can help you to save one click next time when you start putty.

image

image

image

Now open your created putty session, agree for the first time with "PuTTY Security Alert".

If you've set your login in putty, you'll be asked for the ssh shell
password, if not, then you need to enter username to login and then password.
After you've correctly entered password (and login), your SSH session will be
opened.

2. crontab setup

Cron is designed to maintain a list of commands that the system needs to run at a given time intervals.

When your logged in to your server you can use program cron using the following commands:

      $ crontab -l
      Lists the current cron jobs

      $ crontab -e
      Edit your current crontab file and add/remove/edit crontab tasks.

      $ crontab -r
      Remove the crontab file.

      $ crontab -v
      Displays the last time you edited your crontab file.

By default 'crontab -e' will edit crontab file with vi-editor, which can be hard to use for a unix-newbie.
And if you already tried to edit it, you can leave/exit vi-editor by pressing ESC and then :q!

An example of 'crontab -l' command:

image

To use another, more user-friendly editor you need to run edit command as follows:

     $ EDITOR=nano crontab -e

This line tells the shell that your editor will be set to nano followed by a crontab edit command.

image

on the bottom of the screen you can see 2 lines of help. For example pressing CTRL-X will exit editor.

It's preffered to change MAILTO address to your email or role-based (a web-developer) email address.

When you enter the edit mode (crontab -e) and start adding tasks to your cron file you need to consider the following syntax:

image

The asterisk (*) symbolizes that every instance of that field (i.e. every minute, hour, day, month, weekday) will be used in the command.

If you have any questions, don't hesitate to ask us. Thanks.


Credits:
http://www.jfitz.com/tips/putty_config.html
http://www.tutorial5.com/content/view/95/51