You are not logged in.

#1 2013-03-15 15:46:53

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

[solved] cronjob not working

Hi, I can't seem to get a cron job to execute.

I have created the job with:

sudo crontab -e

And then typing in:

0 4 * * * pacmatic -Syyuw --noconfirm

sudo crontab -l gives the same output as above

I see there are quite a few cron entries in my journalctl for various hourly and daily things, but my command doesn't run, I think it has run before once, but it does not work at 4am every morning.

I have enabled the cronnie service

Any ideas?

Last edited by jrussell (2013-05-12 18:46:40)


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#2 2013-03-16 02:56:26

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [solved] cronjob not working

Don't you need to specify user?

Also, you do know this is a bad idea, right? Unless you are never, ever going to type pacman -S <some-great-package>?

Last edited by cfr (2013-03-16 02:57:26)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-03-16 04:00:21

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,730
Website

Re: [solved] cronjob not working

@cfr, no he does not need to sepcify a user, the owner of that cron instance is root (he's using sudo)
@jrussell, make sure you have cron running in systemd as a service.

R.

Last edited by ralvez (2013-03-16 04:00:55)

Offline

#4 2013-03-16 09:31:09

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: [solved] cronjob not working

Seems to have run last night, Ill check again this evening.


cfr wrote:

Don't you need to specify user?

Also, you do know this is a bad idea, right? Unless you are never, ever going to type pacman -S <some-great-package>?

Why is it a bad idea?
Is it somthing to do with pacman vs pacmatic?

What I do is let the updates build up and just download, then once a week or so, I do:

pacmatic -Syu

to install updates, then I reboot and leave it again


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#5 2013-03-16 16:22:39

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [solved] cronjob not working

@ralvez,
Just I noticed that my /etc/crontab specifies the user (root) but I wasn't clear from the man page whether this was necessary or not.

@jrussell,
If you never do pacman (or pacmatic) -S <great-new-package> in between times, it should be fine. But if you do or might do this, it is a bad idea because you have updated the database without updating the installed packages and that can lead to problems. So you'd need to always be certain to do pacman (or pacmatic) -Syu before installing anything new. (You should do this anyway - it is just more important if you are updating the database in the background.)

See the warning box etc. at https://wiki.archlinux.org/index.php/Pa … g_packages.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2013-03-16 16:46:39

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: [solved] cronjob not working

cfr wrote:

@ralvez,
Just I noticed that my /etc/crontab specifies the user (root) but I wasn't clear from the man page whether this was necessary or not.

@jrussell,
If you never do pacman (or pacmatic) -S <great-new-package> in between times, it should be fine. But if you do or might do this, it is a bad idea because you have updated the database without updating the installed packages and that can lead to problems. So you'd need to always be certain to do pacman (or pacmatic) -Syu before installing anything new. (You should do this anyway - it is just more important if you are updating the database in the background.)

See the warning box etc. at https://wiki.archlinux.org/index.php/Pa … g_packages.

Makes sense, thanks smile . Ill be removing that cronjob then!

*Edit
All is working, just made sure cronie.service was running.

Last edited by jrussell (2013-05-12 18:46:21)


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

Board footer

Powered by FluxBB