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-le...@cs.huji.ac.il

Reply via email to