news
Gaming Servers Page Already Available. See Live Demo
Locale Settings
My Hostarina
logo
  • Web Hosting
    Shared Hosting
    Shared Hosting

    For Small to Medium Websites

    Unlimited Hosting
    Unlimited Hosting

    For Blogs, Wordpress, Ecommerce Websites

    Free Website Migration
    1. Buy any web hosting package
    2. Request a site migration from your account
    3. Sit back and let us handle things at a time that suits you
    Get Started

  • Servers
    High Performance VPS
    High Performance VPS

    Your own VPS server to securely run the application with peak performance.

    Cloud VPS Servers
    Cloud VPS Servers

    Your Own Virtual Storage Server for using as Files storage space

    VPS Simple. Fast. Reliable

    When purchasing a VPS, it comes with a list of Operating Systems templates, all Linux based, which can be installed in a couple of clicks, saving you the hassle of doing it yourself.

  • Domains
    My Domains
    My Domains

    Your Domains with us

    Domain Register
    Domain Register

    Find the perfect domain name.

    Domain Whois
    Domain Whois

    Lookup tool to find WHOIS information.

    Domains Prices
    Domains Prices

    Domain Pricing List

    Domain Transfer
    Domain Transfer

    Want to transfer domain to Hostarina?

  • Billing
    Payment Options
    Payment Options

    Our Supported Payment Options

    Affiliates
    Affiliates

    Latest News about our services

  • Support
    Website Migration
    Website Migration

    Buy Web hosting and Request a free website migration

    Announcements
    Announcements

    Latest News about our services

    Knowledgebase
    Knowledgebase

    Knowledgebase Articles to solve your problems

    Network Status
    Network Status

    Our Servers and Services Status information

Cron Jobs - Processing Scripts Automatically
Useful : 0
Views : 0


  • Cron Jobs - Processing Scripts Automatically

Cron Jobs (Automated Job Processing)

    The use of "cron jobs", which are processes or scripts that are run automatically at certain times, in accordance with a "crontab" file set up by each user, are allowed on our servers, subject to the following conditions and restrictions:
    • The job must not execute more often than every two hours.
    • The job must generate no greater impact than a normal CGI script. In other words it must not disrupt the normal operations of our servers or slow down our server processing in any way.
    • The job must be "niced". For details, read about the nice command. The preferred value is 10 or greater.


To use cron, you must first set up a file of cron entries. This file can actually be placed anywhere in your account you like, and have any name you want. It should contain one entry for each action you want taken.

A cron entry looks similar to the following:

30 3 * * *     /usr/local/bin/nice -20 /usr/home/username/script.pl

In this case, the script "script.pl" would be run nightly at 3:30 AM.

"/usr/bin/nice -20" utilizes the system nice command to lower the impact of the call on the server. We recommend that you use it with all your cron jobs, to best preserve system resources.

       


"/usr/home/username/script.pl" is the full path to the script/program you would like cron to run.
You can also use regular UNIX commands here if you like, using full paths to programs.

       


For instance, you could have

30 3 * * *     /usr/local/bin/nice -20 /bin/rm /usr/home/username/temp/*

to remove all files from some temporary directory you might have each night at 3:30 AM, as in the earlier example.  In this case the command remove (rm) is used.  You can find where any command resides by typing this in telnet whereis command.  This will give you the proper directory on your server.

The "30 3 * * *" requires a bit more explaining. The time a cron command is executed is controlled by the 5 numbers that precede the cron directive.

The first number is the minutes after the hour (0-59). 
The second is the hour of the day (0-23, with 0 being 12 AM). 
The third number is the day of the month (1-31). 
The fourth is the month of the year (1-12). 
The fifth is the day of the week (0-6, with 0=Sunday and 6=Saturday, etc).

A * in place of any of the values matches all possibilities (for instance, in the given example the script runs every day because the *'s for day of the month, day of the week, and month of the year match all values).

Multiple values are separated by commas. For instance, you might start with 15 1,3,5 * * * to run a script every day at 1:15, 3:15, and 5:15. (Note that our policies prohibit a program running via cron more often than once every two hours.)

Once you have your cron directive file (say, cron.file) in your account, you must connect via telnet and issue the command:

crontab cron.file

using the name you gave the file. (Note that you must be in the same directory as the cron file at the time.) After this, your cron should be activated. If the programs running via cron generate errors, the cron daemon will e-mail them to your account.

If at any time you would like to change your cron jobs, just edit your file, and rerun the crontab command as shown above.

Domains
  • Register a New Domain
  • Transfer Domain to Us
Support
  • Announcements
  • Knowledgebase
  • Network Status
  • Contact Us
Servers
  • High Performance VPS
  • Virtual Dedicated Server
  • Dedicated Servers
Company
  • About Us
  • Privacy Policy
  • Unlimited Policy
  • Acceptable Use Policy
  • Anti-Spam Policy
  • Refund Policy
  • Terms of services
  • Copyright © 2022 hostarina. All Rights Reserved.