I am trying to execute a command using cron.d. I've tried so far this to test
11 13 * * * root echo \"OK?\" >/tmp/cron-is-ok
which runs fine! Runs as it should. But if I replace the command with
11 13 * * * root useradd -ou 0 -g 0 john1
It doesn't run. I tried shell script like this
11 13 * * * root /home/myUser/Downloads/ascript.sh
but it also doesn't run. There is the
#!/bin/bash header in the beginning. I'm using Debian and I read that the name of the script must not have
.. Tried it, also doesn't work.
If I run the command and script from terminal as a root user it works fine. Any hints?