How to Set and configure Cron job on Ubuntu 12.10 and Ubuntu 12.04


Setting up the cron:

METHOD ONE: victimisation Cron tab manager
If you've got a cron tab manager in your webpanel, it'll be simple for you to line the cron tab operate. you'll click on the icon to open cron manager. there'll be some textarea wherever you'll enter the the script file path that you simply wish the cron job to executes.

Your cron manager could also be totally different from the higher than image, however primarily it's simple to line up cron job along with your cron manager. I extremely suggest this unless you would like to urge to understand concerning the Second Telnet methodology.

METHOD TWO: Uploading ‘cron.txt’ file and checking victimisation telnet
* Cron Commands:

crontab computer file name|computer file name|name}  Install filename as your crontab file
crontab -e        Edit your crontab file, or produce one if it doesn’t exist already.
crontab -l show your crontab file.
crontab -r take away your crontab file.
crontab -v show the last time you emended your crontab file.    
               
* Telnet Steps:

Basically FOUR steps:
1. produce cron.txt
2. Upload
3. Install the txt file as cron file with the command ‘crontab cron.txt’
4. Check your cron file

1. Open your pad on your laptop and write cron job following the rules explained higher than underneath ‘What ar the elements of cron?’.

For example – If you write your cron job like this:

30 twenty three * * * /home/username/www/members.php
After writing the higher than cron job PRESS return in order that a blank line are going to be there below the cron job line.

2. continuously use absolute path for the program line. shut down the ‘Word Wrap’ feature with the pad.

3. Save the file as ‘cron.txt’. transfer it to your root directory (‘/’) wherever you'll see an inventory of folders like public_html,public_ftp,email etc,. Or raise your net host wherever to transfer the cron files. transfer in computer code mode.


When you ftp into your website, initial you'll land on your root directory.

4. currently telnet into your server.

5. you've got to use telnet computer code like putty to login into your server.

At electronic communication kind -

sudo crontab cron.txt

Press Enter.

You will be back at electronic communication.

Then type: (l means that small L)

sudo crontab -l

Press Enter.

You will see the list of cron jobs that you simply have entered in cron.txt.

0 comments:

Post a Comment