System Settings/Task Scheduler: Difference between revisions

From KDE UserBase Wiki
m (Ognarb moved page KCron to System Settings/Task Scheduler without leaving a redirect: KCron is a KCM)
m (Formatting)
Line 15: Line 15:


<!--T:12-->
<!--T:12-->
* Click "New Task..." to add a new task, or "Modify" to modify an existing task. The '''Add or modify existing task''' page will be displayed.
* Click <menuchoice>New Task...</menuchoice> to add a new task, or "Modify" to modify an existing task. The '''Add or modify existing task''' page will be displayed.


<!--T:13-->
<!--T:13-->
Line 40: Line 40:


* When done, click <menuchoice>OK</menuchoice>. The task will be added and scheduled if enabled.
* When done, click <menuchoice>OK</menuchoice>. The task will be added and scheduled if enabled.
{{Tip|Click Run Now to run a task immediately after adding or modifying the task.}}
 
{{Tip|Click <menuchoice>Run Now</menuchoice> to run a task immediately after adding or modifying the task.}}
 
=== Removing a task === <!--T:20-->
=== Removing a task === <!--T:20-->
To completely remove a task, select the task from the list and click the '''Delete''' button. This will permanently remove the task.
To completely remove a task, select the task from the list and click the '''Delete''' button. This will permanently remove the task.


== Environment Variables == <!--T:21-->
== Environment Variables == <!--T:21-->
Sometimes a task or multiple tasks need a specific variable set, it must be added in the '''Environment Variables''' section. The '''cron''' utility uses its own environment, system wide and user specific variables are not used. Click '''New Variable''' to add a new variable definition, or '''Modify''' to change an existing variable.
 
Sometimes a task or multiple tasks need a specific variable set, it must be added in the '''Environment Variables''' section. The '''cron''' utility uses its own environment, system-wide and user-specific variables are not used. Click '''New Variable''' to add a new variable definition, or '''Modify''' to change an existing variable.
 
* Enter the name of the variable to use. This name:
* Enter the name of the variable to use. This name:
** Must consist of letters, digits and underscore ('_') only
** Must consist of letters, digits, and underscore ('_') only
** Must start with a latter
** Must start with a latter
** Should not be a reserved or commonly used system variable. See https://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html for more information
** Should not be a reserved or commonly used system variable. See https://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html for more information
* The value the variable will contain. This can be a number or string.
* The value the variable will contain. This can be a number or string.
* Enter a brief description of the variable.
* Enter a brief description of the variable.



Revision as of 12:44, 3 February 2019

General Information

Task Scheduler is a graphical front end to the standard "cron" utility. With it, commands (or "tasks") can be run at specific times, on a certain day or date, or at specific intervals (time between execution).

Task Scheduler in Plasma 5

Usage

Task Scheduler can be started by starting the System Settings application. Select Startup and Shutdown follwed by Task Scheduler.

Adding and Modifying tasks

  • Click New Task... to add a new task, or "Modify" to modify an existing task. The Add or modify existing task page will be displayed.
The "Add or modify task" page of SystemSettings
  • Enter the command to be run. Click the folder icon to choose it from a dialog.
  • Enter a comment (optional). This should be descriptive, explaining what the task will do as the command may not always be obvious.
  • Click Enable this task to enable the task to run.
  • Click Run at system bootup to enable the script to run each time the system is booted.
  • Click Run every day to enable the script to run every day. This will automatically select the appropriate options.
  • Using the buttons, choose when the command should be run. Not all parameters are required, those not needed may be left blank.
    • Hours and Minutes are the time of day to run the task, not an interval.
  • When done, click OK. The task will be added and scheduled if enabled.

Tip

Click Run Now to run a task immediately after adding or modifying the task.


Removing a task

To completely remove a task, select the task from the list and click the Delete button. This will permanently remove the task.

Environment Variables

Sometimes a task or multiple tasks need a specific variable set, it must be added in the Environment Variables section. The cron utility uses its own environment, system-wide and user-specific variables are not used. Click New Variable to add a new variable definition, or Modify to change an existing variable.

  • The value the variable will contain. This can be a number or string.
  • Enter a brief description of the variable.

Hints

  • All the files that are modified are located in the /etc/cron directory where there are numerous files to look at.
  • The command-line tool that allows you to have a look at the currently installed cron-jobs is
    crontab -l
    (that's the letter L).

More Information