Kcron / Task Scheduler not accepting command line arguments?

Hello,

I’m new to this stuff but I’m very confused here:

I want to setup a scheduled rsync command to backup my browser profile using the following command:

rsync -a --delete "/home/username/.config/zen/wodhtd9y.Default (release)/" "/home/username/Nextcloud/path/to/file/Zen Browser profile/"

this command works perfectly in the command line, but if I try to setup this command in kcron I get the Error:

Command not found: rsync -a --delete

the command rsync without any command line arguments works without problems, so the binary is found, but just adding something like --help returns the same error.

Is this intended?

Am I doing something wrong?

Please help and thank you.

Could be a limitation of the UI or a bug.

Easiest workaround is to create a simple shell script that runs your command, make it executable and use that as the input for command in the UI.

#!/bin/sh
rsync -a --delete "/home/username/.config/zen/wodhtd9y.Default (release)/"  "/home/username/Nextcloud/path/to/file/Zen Browser profile/"

the plasma 5 task scheduler i have installed is v 23.08.5

systemsettings kcm_cron

which has a different UI than what is shown

did this get broken in the move from Qt5 to Qt6 ???

i need this to be working before i can upgrade.

Could also try “inlining” the script in a call to bash.

i.e. the “Befehl” in the GUI would be:

bash -c 'rsync -a --delete "/home/username/.config/zen/wodhtd9y.Default (release)/"  "/home/username/Nextcloud/path/to/file/Zen Browser profile/"'

A valid approach, however it might run into the same issue as it would required “bash” to be recognized as the command and “-c” (and so forth) as arguments.

It seems that the underlying issue is that this separation of command and arguments does not work at all, see the mention of getting an error when trying rsync –help

Ah yes - not necessarily my best suggestion :slightly_smiling_face:

can confirm, same problem with “bash -c” not found.

I don’t see kcm_cron anywhere in my package repositories (CachyOS), so I don’t really know. I just installed the kcron package (KDE Kcron, cant post the link to the kde page) and the task scheduler showed up in the system settings. I’m on the newest stable on everything afaik

if you look into what kcron is actually doing in the applications editor or .desktop file, you should find that it is running

systemsettings kcm_cron

if you type that into a terminal it should also run the kcron app.

yours just looks different, and you are having these issues… which makes me suspect something has changed from plasma 5 to plasma 6 that broke it.

Ah, got it. And can confirm systemsettings kcm_cron starts it and is used in the application shortcut. Thanks for the explanation.