Crontab not working in Domain-0?

I don’t know what’s going on, but I can’t get crontab to work.
I have added everything correctly, told it what script to execute, but it’s not doing anything, it doesn’t even run the script.
Not to mention there are no log files for cron, even though cron is set up to have logging enabled.

Anyone have any thoguhts?

I’m having to get this script going because attempting it in libxl hook causes things to crash and not function. It locks the whole system up, even though the entire thing should work properly.

So libxl creates the file, then the cron job reads the file if it exists.

But crontab isn’t running the script.
I can run the script manually, and it works perfectly.

          • root /scripts/script.sh

Any thoguhts?

/scripts/script.sh is a full path to script file?

to check crontab for root

sudo crontab -l

to check if script.sh runs as root

sudo journalctl -b -g "script.sh"

and you might add some loggign to /tmp inside the script

I have it outputting to a file, it also removes a file that was created. It doesn’t do any such thing.

“no crontab for root”

Yet crontab is a global thing… So why would it not exist?

I get no crontab for any user…

how did you set crontab?

The normal, standard, default, administrative way.

Put it into the crontab.

There are two way:

sudo crontab -e

it goes to /var/spool/cron/root (edition in VIM)

or manual editing /etc/crontab

If later then check if it have empty line after cron job

You can also check

journalctl -b -u crond

if there’s any error

Then put me down as an intellectual. I do it “manually”.

Now the problem is that crontab isn’t working, so I need to know where the config files are for it, and where the log files are.

Should say that it does load it, but that script isn’t being executed, and no “user” has a “crontab -l”

/etc/contab (you said that you edited it, so you know where config files are) is system wide crontab, not user specific

check journalctl -b -u crond

and you can check if you have error in config file by

crontab -T /etc/crontab

I’ll put it this way…

There are 0 reported issues or findable issues that I have found.

Everything loads correctly and reports fine… But it doesn’t run that script…

If you can just tell me where the log file is for the cron daemon then I’ll be able to at least see watch the log for it.

sudo journalctl -b -u crond
… will log every invocation of jobs in /etc/crontab

EDIT: as @KitsuneNoBaka wrote above.
EDIT2: another thing to check: is the crond running? sudo systemctl status crond

Another thing.
Cron jobs runs without any environment. There is rather short list of $PATH added at the beginning of /etc/crontab (only this file can use that) so if your script uses any app that’s not internal bash command then every such app should be invoked in script with full path.

You can also redirect every terminal output of script.sh to log

0 * 0 0 0 root /scripts/script.sh 1>>/tmp/script.log 2>&1