Registered Member
|
Till I get to that, I noticed something else; If I open the System Monitor and filter with "cron", only one process with this name is running from root. Shouldn't I have a process called cron or kcron on my username? This does feel like for some reason the service might not be starting up somehow.
|
Manager
|
you should have only 1 cron in Ksysguard, it's a daemon for all cron jobs for all users
Kcron is not a daemon it's just a KDE gui front end for setting up cron jobs |
Manager
|
you could try creating a cron job using the crontab command (Google for a tutorial) and bypassing kcron, to see if there's a kcron issue.
crontab -l will display any cron jobs you've scheduled using crontab or kcron |
Registered Member
|
The crontab -l command lists my task correctly.
|
Administrator
|
This appears to be setup correctly then.
The 'root' cron process will execute the backup command as scheduled under your user account when necessary. Note that if "autobackup" is not in PATH it will likely fail to execute (Cron usually uses a restricted definition of PATH as well). Also note that processes run by cron will not have access to your graphical console, or desktop session. They should ideally be full independent CLI scripts.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Ahhh... that might be it then. The "autobackup" script file is located in ~/bin so simply typing its name in bash executes it. I noticed that Kcron asks me to define path variables at the bottom of the menu still, but I thought those are optional and system paths are automatically used. What should I add there? Do I include "/home/username/bin" or "~/bin"? |
Administrator
|
In this instance, just provide the full path to the command - as it will be the method most assured of success.
ie. /home/username/bin/autobackup You should ensure that this script has an appropriate shebang line if it is a script, as you may be relying on bash features without being aware.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Will add the full path. What line should I add though? I already have the #!/bin/bash line... should I add the .sh extension too (and name the file autobackup.sh)? |
Manager
|
As long as the file's permission is executable and the #! /bin/bash is the first line it should execute fine. The use of ".sh" is more for informational purposes.
|
Registered Member
|
Yay, it seems to execute now! Adding the full path to the script fixed it. Thanks for the help
|
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]