Connect with us
This tutorial will show you how to setup a cron job using Plesk 10 on a Linux VPS. Like cPanel, Plesk is a widely available hosting control panel, providing a GUI through which users can configure their hosting.
What is a cron job?
A cron job, also referred to as a 'scheduled task', is simply a command (e.g. go to a particular URL) which is executed at a specified time.
You may, for example, setup a cron job to access the URL of a PHP file (e.g. http://www.example.com/test.php) once every day. Accessing that PHP file could in turn run whatever code the file contained, and that code could then in turn initiate other tasks such as creating a database backup or clearing log files.
In short, cron jobs can be a useful way of performing, or initiating, (recurring) tasks.
So, let's get started...
1. Log into Plesk and click the 'Subscriptions' link
Logging into Plesk will bring you to your Plesk panel's home page.
We first need to select which VPS subscription we want to associate the cron job with. So, click the 'Subscriptions' link in the left sidebar

2. Select the relevant control panel
Click the 'Control Panel' link for the subscription you want to associate the cron job with. In this example we only have one subscription ('example.com', which is subscribed to our 'Unlimited' plan) so we click its 'Control Panel' link

3. Navigate to the 'Scheduled Tasks' page
Clicking the 'Control Panel' link opens our chosen subscription's control panel home page. Cron jobs are categorised under 'Websites & Domains' so click the 'Websites & Domains' menu tab

and in the 'Websites & Domains' section scroll down and click 'Show Advanced Operations'

Now click 'Scheduled Tasks' ('Scheduled tasks' is how Plesk generally refers to cron jobs)

This opens the 'System Users' page. Click on the name of the subscription's system user

4. Schedule a new task
On the 'Scheduled Tasks' page click 'Schedule New Task'

which will load the 'Schedule a Task' form (in this screenshot we've already filled the form fields)

Our cron job is switched on and will fire on the fifteenth minute (15) of the third hour (3) of every day of the month (*) of every month (*) of every day of the week (*) and execute the command
/usr/bin/wget -O - -q http://www.example.com/test.php
Or, to put it more clearly, our cron job will fire every day at 3.15am and hit the URL
http://www.example.com/test.php
Cron job configuration
There are three key parts to our cron job configuration:
-
Is the cron job switched on or not? - i.e. should it fire or not?
We want our cron job to fire, so we ensure the 'Switched on' checkbox is checked.
-
What time should the cron job fire?
Times can be set for each field by entering numeric values, or in the case of 'Month' and 'Day of the week' by selecting from a dropdown.
The basic values which can be entered are:
Minute 0 to 59 Hour 0 to 23 Day of the month 1 to 31 Month 1 to 12, or choose from the dropdown Day of the week 0 to 6 (0 for Sunday), or choose from the dropdown Further manipulation of cron times can be achieved with the asterisk (*):
-
On its own, an asterisk means 'every'. In our example we use an asterisk to represent every day of the month, every month, and every day of the week
-
Combining an asterisk with a forward slash and a number means 'every x number of'. So, if we instead wanted our cron job to fire every three hours we'd replace the '3' in the 'Hour' field with '*/3'

Note: Numeric values, forward slashes, and asterisks will probably be sufficient for timing the majority of cron jobs, however cron expressions can be further extended using other special characters (comma (,), hyphen (-), question mark (?), L, W, and pound (#)).
-
-
What command should the cron job execute?
We're using the command
/usr/bin/wget -O - -q http://www.example.com/test.phpThis command is made up of three parts:
-
/usr/bin/wgetFirstly, we specify the path to the utility we want to use to execute the command. Here we're using a Unix utility called 'Wget', which is located on our server at '/usr/bin/wget'.
Note: alternative Unix utilities which could be used include lynx and curl.
-
-O - -qSecondly, we specify what to do with any output generated as a result of our command executing.
All we want to do is retrieve the URL
http://www.example.com/test.php, so we set wget options which will discard any output and prevent cron's default behavior of sending an email notification to the user executing the command (i.e. us):-O -
takes any output ('-O') and sends it to stdout ('-')-q
turns off any output. This means both that the output we've sent to stdout is effectively discarded, and that cron will not send us email -
http://www.example.com/test.phpLastly, we specify the URL which the command should retrieve.
-
Create it
Click the 'OK' button. The cron job will be created and a confirmation message shown

Our cron job is now listed under 'Scheduled Tasks' and ready to go.
- Popular currencies
- All currencies
- Afghanistani Afghani (AFA)
- Albanian Lek (ALL)
- Algerian Dinar (DZD)
- Argentine Peso (ARS)
- Aruba Florin (AWG)
- Australian Dollar (AUD)
- Azerbaijan New Maneat (AZN)
- Bahamian Dollar (BSD)
- Bahraini Dinar (BHD)
- Bangladeshi Taka (BDT)
- Barbadian Dollar (BBD)
- Belarus Ruble (BYR)
- Belize Dollar (BZD)
- Bermuda Dollar (BMD)
- Bhutanese Ngultrum (BTN)
- Bolivian Boliviano (BOB)
- Bosnia and Herzegovina (BAM)
- Botswana Pula (BWP)
- Brazilian Real (BRL)
- British Pound (GBP)
- Brunei Dollar (BND)
- Bulgarian Lev (BGN)
- Burundi Franc (BIF)
- Cambodia Riel (KHR)
- Canadian Dollar (CAD)
- Cape Verdean Escudo (CVE)
- Cayman Islands Dollar (KYD)
- CFA Franc (BCEAO) (XOF)
- CFA Franc (BEAC) (XAF)
- Chilean Peso (CLP)
- Chinese Yuan (CNY)
- Colombian Peso (COP)
- Comoros Franc (KMF)
- Costa Rica Colon (CRC)
- Croatian Kuna (HRK)
- Cuban Peso (CUP)
- Cyprus Pound (CYP)
- Czech Koruna (CZK)
- Danish Krone (DKK)
- Dijiboutian Franc (DJF)
- Dominican Peso (DOP)
- East Caribbean Dollar (XCD)
- Egyptian Pound (EGP)
- El Salvador Colon (SVC)
- Eritrean Nakfa (ERN)
- Estonian Kroon (EEK)
- Ethiopian Birr (ETB)
- Euro (EUR)
- Falkland Islands Pound (FKP)
- Fiji Dollar (FJD)
- Gambian Dalasi (GMD)
- Ghanian Cedi (GHC)
- Gibraltar Pound (GIP)
- Gold Ounces (XAU)
- Guatemala Quetzal (GTQ)
- Guernsey Pound (GGP)
- Guinea Franc (GNF)
- Guyana Dollar (GYD)
- Haiti Gourde (HTG)
- Honduras Lempira (HNL)
- Hong Kong Dollar (HKD)
- Hungarian Forint (HUF)
- Iceland Krona (ISK)
- Indian Rupee (INR)
- Indonesian Rupiah (IDR)
- Iran Rial (IRR)
- Iraqi Dinar (IQD)
- Israeli Shekel (ILS)
- Jamaican Dollar (JMD)
- Japanese Yen (JPY)
- Jordanian Dinar (JOD)
- Kazakhstan Tenge (KZT)
- Kenyan Shilling (KES)
- Korean Won (KRW)
- Kuwaiti Dinar (KWD)
- Kyrgyzstan Som (KGS)
- Lao Kip (LAK)
- Latvian Lat (LVL)
- Lebanese Pound (LBP)
- Lesotho Loti (LSL)
- Liberian Dollar (LRD)
- Libyan Dinar (LYD)
- Lithuanian Lita (LTL)
- Macau Pataca (MOP)
- Macedonian Denar (MKD)
- iraimbilanja
- Malawian Kwacha (MWK)
- Malaysian Ringgit (MYR)
- Maldives Rufiyaa (MVR)
- Maltese Lira (MTL)
- Mauritania Ougulya (MRO)
- Mauritius Rupee (MUR)
- Mexican Peso (MXN)
- Moldovan Leu (MDL)
- Mongolian Tugrik (MNT)
- Moroccan Dirham (MAD)
- Mozambique Metical (MZM)
- Myanmar Kyat (MMK)
- Namibian Dollar (NAD)
- Nepalese Rupee (NPR)
- Neth Antilles Guilder (ANG)
- New Turkish Lira (TRY)
- New Zealand Dollar (NZD)
- Nicaragua Cordoba (NIO)
- Nigerian Naira (NGN)
- North Korean Won (KPW)
- Norwegian Krone (NOK)
- Omani Rial (OMR)
- Pacific Franc (XPF)
- Pakistani Rupee (PKR)
- Palladium Ounces (XPD)
- Panama Balboa (PAB)
- Papua New Guinea Kina (PGK)
- Paraguayan Guarani (PYG)
- Peruvian Nuevo Sol (PEN)
- Philippine Peso (PHP)
- Platinum Ounces (XPT)
- Polish Zloty (PLN)
- Qatar Rial (QAR)
- Romanian New Leu (RON)
- Russian Rouble (RUB)
- Rwandese Franc (RWF)
- Samoan Tala (WST)
- Sao Tome Dobra (STD)
- Saudi Arabian Riyal (SAR)
- Seychelles Rupee (SCR)
- Serbian Dinar (RSD)
- Sierra Leone Leone (SLL)
- Silver Ounces (XAG)
- Singapore Dollar (SGD)
- Slovak Koruna (SKK)
- Solomon Islands Dollar (SBD)
- Somali Shilling (SOS)
- South African Rand (ZAR)
- Sri Lanka Rupee (LKR)
- St Helena Pound (SHP)
- Sudanese Dinar (SDD)
- Surinam Dollar (SRD)
- Swaziland Lilageni (SZL)
- Swedish Krona (SEK)
- Swiss Franc (CHF)
- Syrian Pound (SYP)
- Taiwan Dollar (TWD)
- Tanzanian Shilling (TZS)
- Thai Baht (THB)
- Tonga Pa'anga (TOP)
- Trinidad & Tobago Dollar (TTD)
- Tunisian Dinar (TND)
- U.S. Dollar (USD)
- UAE Dirham (AED)
- Ugandan Shilling (UGX)
- Ukraine Hryvnia (UAH)
- Uruguayan New Peso (UYU)
- Uzbekistan Sum (UZS)
- Vanuatu Vatu (VUV)
- Venezuelan Bolivar (VEB)
- Vietnam Dong (VND)
- Yemen Riyal (YER)
- Yugoslav Dinar (YUM)
- Zambian Kwacha (ZMK)
- Zimbabwe Dollar (ZWD)
