X
X
X
X

Knowledge Base

HomepageKnowledge BaseWeb Hosting InformationResourcesScheduled Tasks – PixelLegio...

Scheduled Tasks – PixelLegion

Scheduled Tasks – PixelLegion Control Panel

With scheduled tasks (cronjobs), you can automate commands or scripts to run at specified times or intervals.


Creating a New Scheduled Task

1️⃣ Click on the "Create New Task" button
2️⃣ Fill in the following fields:

Enabled? – Check this box to activate the task.
Command: – Enter the command or script to be executed. (See: Entering Commands section)
Description: – Provide a short description for easy identification.
Schedule: – Choose a predefined time interval or use cron style for a custom schedule:

  • Hourly: Specify the minute to start execution.
  • Daily: Set the time of day to execute.
  • Weekly: Choose the day and time for execution.
  • Monthly: Set the day of the month and time for execution.
  • Yearly: Specify the exact date and time for execution.
  • Cron Style: Use advanced scheduling (See: Cron Style section)
    Email Notification: – Enter an email address to receive execution or error notifications from the cron service.

3️⃣ Click the "Save" button


Managing Scheduled Tasks

All created cronjobs will appear in an overview list. The icons have the following meanings:

Active cronjob
Inactive cronjob
View command
View scheduled execution time
Edit task
Delete task (with confirmation prompt)
Bulk delete (select multiple tasks before deleting)


Entering Commands for Scheduled Tasks

Always specify the full path to the script you want to execute!

Running a shell script:

/home/users/username/files/myscript.sh

Using system commands with full path:

/usr/bin/rsync -avz /backup /storage

Running a PHP script via PHP-CLI:

/usr/bin/php -f /path/to/script/cron.php

Executing a web script via Lynx browser (may need to be installed):

/usr/bin/lynx –dump http://example.com/cron.php

Executing a web script using wget:

/usr/bin/wget -q -O /dev/null http://example.com/cron.php

Using Cron Style for Scheduling

A cron schedule consists of five parameters separated by spaces or tabs:

minute hour day month weekday

Examples of cron schedules:

Cron Style Meaning
* * * * * Every minute
0 0 * * * Daily at midnight
5 * * * * At 5 minutes past every hour
*/15 * * * * Every 15 minutes
0 * 15 * * Every hour on the 15th day of the month
15 20 * * 6 Every Saturday at 8:15 PM
20,30 1 * * 1-5 Monday to Friday at 1:20 AM and 1:30 AM

Simplified Scheduling Keywords:

Keyword Meaning Cron Style
@reboot At system startup -
@daily Once a day 0 0 * * *
@midnight Once a day 0 0 * * *
@hourly Once per hour 0 * * * *
@weekly Once per week 0 0 * * 0
@monthly Once per month 0 0 1 * *
@annually Once per year 0 0 1 1 *
@yearly Once per year 0 0 1 1 *

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?
(8 times viewed / 0 people found it helpful)

Top