Use the KDE Task Scheduler again in Archlinux

The KDE * Task Planner *, as its name indicates, is a tool that allows us to easily schedule various tasks using the user's or system's Cron.

What we use ** Archlinux ** and derivatives with the KDE Desktop Environment, we must know that with the implementation of the * hated / loved Systemd *, the KDE Task Scheduler stopped working as it works with Crontab.

Perhaps the Task Scheduler could be tricked into using [Systemd to control scheduled tasks] (https://wiki.archlinux.org/index.php/Systemd/Timers#As_a_cron_replacement "Timers on Systems"), but not life has to be complicated, since using Cronie we can solve this.

In another article my colleague **el Arenoso** explained how to [install and use *Cronie*](https://blog.desdelinux.net/usar-crontab-en-archlinux-con-cronie/ "Reuse Crontab in ArchLinux using Cronie") so there is no need to repeat it. Therefore I will dedicate myself to showing how to schedule a task in KDE and demonstrate that it works.

### How to schedule a task in KDE?

Once we have Cronie installed, we can check that we do not have any scheduled tasks by typing in the console:

`$crontab -e`

If everything is fine they will notice that there is nothing written, so we go out and create the script that we are going to program as a task. We open the terminal and put:

$ touch ~ / script.sh $ echo 'mkdir ~ / CRON /'> ~ / script.sh $ chmod a + x ~ / script.sh

Now we go to the Start Menu »System Preferences» Task Planner and we get this:

KDE Task Planner

Now we click where it says New homework... and we should get something like this:

Task_planner_KDE1

Now I will briefly explain each field and its options.

** Order: ** There we place the script that we just created. Well we can put the full path * / home / user / script.sh * or simply click on the button to the right of the field to search for the * script *. If the script does not exist, the button will not be activated Apply

** Comment: ** As its name indicates in this field, we can establish a comment to know what function this task has. It is not mandatory.

Then we have 3 * Checkbuttons * which are:

** Activate the task **: Obviously we can activate or deactivate the task by checking / unchecking this option.

** Run when the system starts **: It is an alternative to ** Starting applications at startup ** because what we program will be executed when we start the system, as its name indicates.

** Run every day **: If we activate this option, some of the fields that come later will be marked, in this case ** Months **, ** Day of the month **, ** Days of the week **, because as it is logical, we will execute the task every day.

Now we only have to define the ** Hour ** and the ** Minutes ** in which the task will be executed. In the case of ** Minutes **, there is a drop-down menu that allows us to be a little more specific in terms of time in minutes.

### Proving it works

Now I am going to schedule my script to run every day, every 5 minutes. Therefore I would have the Task Planner in this way:

Task_planner_KDE2

And to verify that it is really using the user's cron, we write again in console:

`$crontab -e`

and we will see something like this:

#Script to create the CRON folder every 5 minutes * / 5 * * * * /home/elav/script.sh # File generated with KCron on Saturday, March 21, 2015 12:03 PM.

And that's it. Thanks Cronie we can now use this tool again in KDE.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Gerardo said

    Very interesting and testing it, thanks for so much knowledge, just one question I use cron in ubuntu 14.04 with reference to a script but apparently it doesn't work for me, it doesn't run the cron for me, will there be an application like this for ubuntu? I say to make it a little more graphic
    Thank you

      1.    Gerardo said

        Thank you for answering and right now I am doing the tests and commenting thank you very much

  2.   Johnny Salazar said

    For MANJARO users, the "Task Scheduler" does not come by default in "System Preferences", I don't know why.
    To enable it, "kcron" must be installed, and so it appears next to Systend in the System Preferences screen.

  3.   Rocio said

    One question: these planners allow you to specify dependencies: that is, that task 3 does not run until they have finished 1 and 2 for example, or if 2 gives an error instead of 3, run 4

    I'm looking for an alternative to CTRL-M, but I don't see anything like it

    Thank you
    Rocio