Re: problem with cron on Kubuntu 22.04

2024-02-09 Thread shimi
On Wed, Feb 7, 2024 at 6:44 PM Mark E. Fuller 
wrote:

> need to run `sudo systemctl enable cron` to get it going at every boot
> and `sudo systemctl start cron` to start it immediately
>

Or better, 'sudo systemctl enable --now cron', which does both actions in
one command. ditto for 'disable' / stop.

P.S. I know the OP's issue has been resolved, this is for future Googlers...
___
Linux-il mailing list -- linux-il@cs.huji.ac.il
To unsubscribe send an email to linux-il-le...@cs.huji.ac.il


Re: problem with cron on Kubuntu 22.04

2024-02-07 Thread Shlomo Solomon
THANK YOU 
Your guess was wrong, but sudo systemctl status cron (which I did not
think of before) helped me find the problem.
The service WAS running, but the output of that command showed that the
owner of /etc/crontab was not root.

A stupid mistake on my part - I copied the file from another computer
and did not change the owner. But I would not have found the error
without your help, so again - THANK YOU !


 


On Wed, 7 Feb 2024 11:43:46 -0500
"Mark E. Fuller"  wrote:

> 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
> > אורי  wrote:
> >
> >> Try to remove the word "root"
> >> אורי
> >> u...@speedy.net
> >>
> >>
> >> On Wed, Feb 7, 2024 at 5:18 PM Shlomo Solomon
> >>   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 "" >> tst.txt
> >>>
> >>> If I do:  cd /home/shoshana/Desktop
> >>>./tstrun
> >>> the script works and I see   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 "" >> 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 tolinux-il-le...@cs.huji.ac.il
> >>>
> >
> >
> 



-- 
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


Re: problem with cron on Kubuntu 22.04

2024-02-07 Thread Mark E. Fuller
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
אורי  wrote:


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


On Wed, Feb 7, 2024 at 5:18 PM Shlomo Solomon
  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 "" >> tst.txt

If I do:  cd /home/shoshana/Desktop
   ./tstrun
the script works and I see   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 "" >> 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 tolinux-il-le...@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.ful...@gmail.com
mark.e.ful...@gmx.de
@fuller:one.ems.host
https://mefuller.dev
PGP Fingerprint: 73F1 A30C BDF4 DB4B C75F FD0F D599 E76C FFCA BF60
___
Linux-il mailing list -- linux-il@cs.huji.ac.il
To unsubscribe send an email to linux-il-le...@cs.huji.ac.il


Re: problem with cron on Kubuntu 22.04

2024-02-07 Thread Shlomo Solomon
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
אורי  wrote:

> Try to remove the word "root"
> אורי
> u...@speedy.net
> 
> 
> On Wed, Feb 7, 2024 at 5:18 PM Shlomo Solomon
>  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 "" >> tst.txt
> >
> > If I do:  cd /home/shoshana/Desktop
> >   ./tstrun
> > the script works and I see   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 "" >> 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
> >



-- 
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


Re: problem with cron on Kubuntu 22.04

2024-02-07 Thread אורי
Try to remove the word "root"
אורי
u...@speedy.net


On Wed, Feb 7, 2024 at 5:18 PM Shlomo Solomon 
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 "" >> tst.txt
>
> If I do:  cd /home/shoshana/Desktop
>   ./tstrun
> the script works and I see   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 "" >> 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
>
___
Linux-il mailing list -- linux-il@cs.huji.ac.il
To unsubscribe send an email to linux-il-le...@cs.huji.ac.il


problem with cron on Kubuntu 22.04

2024-02-07 Thread Shlomo Solomon
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 "" >> tst.txt

If I do:  cd /home/shoshana/Desktop
  ./tstrun
the script works and I see   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 "" >> 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