If I had to hazard a guess, it has something to do with systemd (the usual suspect)

What does `
sudo systemctl status cron` return?

If that shows the service being disabled or stopped, you'll of course need to run `
sudo systemctl enable cron` to get it going at every boot and `sudo systemctl start cron` to start it immediately

On 07-Feb-24 11:23, Shlomo Solomon wrote:
No - that did not change anything and, in any case, as I wrote, that
exact line (including root) works on another Kubuntu 22.04 machine.

It also worked on Kubuntu 20.04 before I did a new install of 22.04



On Wed, 7 Feb 2024 17:41:05 +0200
אורי <uri@speedy.net> wrote:

Try to remove the word "root"
אורי
uri@speedy.net


On Wed, Feb 7, 2024 at 5:18 PM Shlomo Solomon
<shlomo.solomon@gmail.com> wrote:

Sorry if this is a bit long, but I wanted to give as much
information as I could and hope someone can help.


On a new installation of Kubuntu 22.04, cron jobs are not running
and this is driving me crazy.

The cron daemon is running

shoshana@shoshana:~/Desktop$ pgrep cron
827

I thought there might be a problem with a specific job so I created
the following simple script (which DOES work).

shoshana@shoshana:~/Desktop$ cat tstrun
#!/usr/bin/sh
cd /home/shoshana/Desktop
echo "aaaa" >> tst.txt

If I do:  cd /home/shoshana/Desktop
          ./tstrun
the script works and I see aaaa  in tst.txt

I then deleted ALL jobs in crontab and added only the following to
/etc/crontab
*/1 * * * * root /home/shoshana/Desktop/tstrun

Nothing happens - nothing written in tst.txt

I tried:
sudo grep CRON /var/log/syslog   and got no output

I changed the script to:
#!/usr/bin/sh
echo "test echo from tstrun"
cd /home/shoshana/Desktop
echo "aaaa" >> tst.txt

and changed the crontab line to:
*/1 * * * * root /home/shoshana/Desktop/tstrun >>
/home/shoshana/Desktop/tstrun-log.txt

still no output in tst.txt and also no output in
/home/shoshana/Desktop/tstrun-log.txt

And as expected, if I do:
./tstrun >> tstrun-log.txt
I see the expected output in both files

I also tried:
shoshana@shoshana:~/Desktop$ sudo service cron stop
shoshana@shoshana:~/Desktop$ sudo service cron start
shoshana@shoshana:~/Desktop$ pgrep cron
3377

AND
shoshana@shoshana:~/Desktop$ sudo systemctl stop cron
shoshana@shoshana:~/Desktop$ sudo systemctl start cron
shoshana@shoshana:~/Desktop$ pgrep cron
3413


But still no change.

And just to be clear, on a different machine (also Kubuntu 22.04)
all the above DOES work - output to both files and if I do:
sudo grep CRON /var/log/syslog   I get:
Feb  7 17:13:01 solomon-laptop CRON[16619]: (root) CMD
(/home/solomon/Desktop/tstrun)






--
Shlomo Solomon
http://the-solomons.net
Claws Mail 3.17.5 - KDE Plasma 5.18.5 - Kubuntu 20.04
_______________________________________________
Linux-il mailing list -- linux-il@cs.huji.ac.il
To unsubscribe send an email to linux-il-leave@cs.huji.ac.il




-- 
Mark E. Fuller, Ph.D.
529 East 85th St., Apt. 3C
New York, NY 10028, USA
+1 646-331-4567 (cell)
+1 929-339-0054 (home)
+972 (0)53-872-6579
+49 (0)1577-1848188
mark.e.fuller@gmail.com
mark.e.fuller@gmx.de
@fuller:one.ems.host
https://mefuller.dev
PGP Fingerprint: 73F1 A30C BDF4 DB4B C75F FD0F D599 E76C FFCA BF60