You are not logged in.

#1 2013-06-05 12:14:38

BeryJu
Member
Registered: 2013-06-05
Posts: 4
Website

[Cron] Crontab not working

My crontab is

SHELL=/bin/bash

* */5 * * * root /var/scripts/backup.sh

which should execute a Backup script every 5 hrs.
But it just doesn't. I don't get any error, it;'s just not executed, as you can see here:
7b9c8a128c7164fbf7d8d4f7a6993e45.png

Offline

#2 2013-06-05 12:19:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,427

Re: [Cron] Crontab not working

Are you using systemd? Have you enabled the cron (e.g. cronie) service?

Offline

#3 2013-06-05 12:33:08

BeryJu
Member
Registered: 2013-06-05
Posts: 4
Website

Re: [Cron] Crontab not working

[root@Lina yt]# systemctl start cronie
[root@Lina yt]# systemctl start cronie.service

That might have solved the problem,

Apparently not.
Tried

* * * * * root touch /home/beryju/derp.sh

No file was created.

Offline

#4 2013-06-05 14:51:06

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 801

Re: [Cron] Crontab not working

If it really is "your" crontab (i.e. where users' crontabs are stored, belonging to root or any other user: under /var/spool/crontab) remove the "root" bit.

If it is a system crontab (something under /etc/cron.d) then I don't know what's wrong.

Last edited by vacant (2013-06-05 14:52:31)

Offline

#5 2013-06-05 15:58:00

ball
Member
From: Germany
Registered: 2011-12-23
Posts: 164

Re: [Cron] Crontab not working

The crontab man page says that you should edit the crontab with the "crontab -e" command. Did you do that?

Offline

#6 2013-06-17 14:39:53

Kilzool
Member
From: Ireland
Registered: 2010-08-04
Posts: 228

Re: [Cron] Crontab not working

Seems I have the same issue.  I have no issue with a 'root' task, but a user task, I do.

I have also put 'all' in /etc/cron.allow and nothing in /etc/cron.deny

I have created my job using 'crontab -e' and created the task as follows:

@weekly backup /usr/local/bin/backup.sh

the /usr/local/bin/backup.sh is owned by me.

---------------------------

Its been more than a week and it is not processing it.
I can run the process myself (the script file).

in /var/spool/cron
I see my entry.

in /var/spool/anacron
I only see root's tasks

I also notice there is no /var/spool/crontabs

I'm quite puzzled.  Is anacron going to do my task or crond ?

dcron was working, and I hope someone brings that AUR package back to life.

Offline

#7 2013-06-17 18:23:54

geno.nullfree
Member
From: en_US
Registered: 2013-05-29
Posts: 17

Re: [Cron] Crontab not working

Do you have a blank (new)line at the end of your crontab? This is necessary for the crontab to be executed I believe.

Last edited by geno.nullfree (2013-06-17 18:24:49)

Offline

#8 2013-06-18 08:08:36

x33a
Forum Moderator
Registered: 2009-08-15
Posts: 3,336
Website

Re: [Cron] Crontab not working

Kilzool wrote:

dcron was working, and I hope someone brings that AUR package back to life.

dcron is working.

You can use JonnyJD's PKGBUILD.

https://aur.archlinux.org/packages/dcron/

Offline

#9 2013-06-20 18:51:58

Kilzool
Member
From: Ireland
Registered: 2010-08-04
Posts: 228

Re: [Cron] Crontab not working

x33a wrote:
Kilzool wrote:

dcron was working, and I hope someone brings that AUR package back to life.

dcron is working.

You can use JonnyJD's PKGBUILD.

https://aur.archlinux.org/packages/dcron/


I would, however, it is : Flagged out-of-date (2013-06-03)

Offline

#10 2013-06-20 18:52:30

Kilzool
Member
From: Ireland
Registered: 2010-08-04
Posts: 228

Re: [Cron] Crontab not working

geno.nullfree wrote:

Do you have a blank (new)line at the end of your crontab? This is necessary for the crontab to be executed I believe.

No I have not, but will try that.

Offline

#11 2013-06-20 23:58:41

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: [Cron] Crontab not working

Kilzool wrote:

I would, however, it is : Flagged out-of-date (2013-06-03)

You should really try reading the comments for the AUR package...

Offline

#12 2013-06-22 16:02:38

Kilzool
Member
From: Ireland
Registered: 2010-08-04
Posts: 228

Re: [Cron] Crontab not working

WonderWoofy wrote:
Kilzool wrote:

I would, however, it is : Flagged out-of-date (2013-06-03)

You should really try reading the comments for the AUR package...

I went back and read it.  Installed it, too.

Thank you and thanks to JohnnyD and those who keep dcron working for us that PREFER it.

Offline

#13 2013-06-22 18:33:30

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: [Cron] Crontab not working

Kilzool wrote:

...for us that PREFER it.

I fail to understand why you needed to yell "prefer" here.  No one is telling you that using dcron is not okay.  By all means, use whatever cron implementation you wish.  If this is somehow an attempt to emphasize your dismay at it not being in the official repos, you have to remember that there are still two implentations of cron in the repos (cronie and fcron) and that it takes developer or TU interest to keep these things there.  It would be silly to expect maintenence of a piece of software that the potential maintainer didn't have any interest in.

Offline

Board footer

Powered by FluxBB