You are not logged in.

#1 2017-11-14 11:43:31

eeenilsson
Member
Registered: 2017-04-26
Posts: 11

[SOLVED] Fcron fails to start

Installed fcron and used fcrontab -e to create the following crontab file:

%mins,nice(7) 1 08-18 firefox

Edit: This was replaced with "01 * * * * /bin/echo Hello, world!" to avoid any problems specific to starting firefox (see comments below).

Then used:
systemctl enable fcron
systemctl start fcron

I think this should execute every minute, but nothing happens. How do I go about troubleshooting this?

Last edited by eeenilsson (2017-11-14 14:21:24)

Offline

#2 2017-11-14 11:55:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: [SOLVED] Fcron fails to start


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2017-11-14 12:02:00

eeenilsson
Member
Registered: 2017-04-26
Posts: 11

Re: [SOLVED] Fcron fails to start

Thanks!

Tried instead adding the following to fcrontab:

13 00 * * * DISPLAY=:0.0 /usr/lib/firefox/firefox

and

13 00 * * * env DISPLAY=:0 /usr/lib/firefox/firefox

(ie at 13:00, 2 minutes after running systemctl fcron start)

..but no effect.

Last edited by eeenilsson (2017-11-14 12:07:00)

Offline

#4 2017-11-14 12:07:00

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: [SOLVED] Fcron fails to start

I'm not particularly familiar with crontabs - but there is no time zone in which the time of 13 minutes after midnight passed between our posts.

EDIT: 13 00 is not 1300, it is 0013.  Again, read the documentation first.

Last edited by Trilby (2017-11-14 12:08:17)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2017-11-14 12:12:13

eeenilsson
Member
Registered: 2017-04-26
Posts: 11

Re: [SOLVED] Fcron fails to start

Thanks! (I guess newbies corner is really the correct place for me to post). I tried adding:

08 13 * * * env DISPLAY=:0 /usr/lib/firefox/firefox   (ie corrected time setting 13:08)

@ 1 * * * * env DISPLAY=:0 /usr/lib/firefox/firefox (should execute every minute)

...but still nothing.

Last edited by eeenilsson (2017-11-14 12:17:45)

Offline

#6 2017-11-14 12:27:49

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Fcron fails to start

Surely the path should be /usr/bin/firefox ?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2017-11-14 12:35:35

eeenilsson
Member
Registered: 2017-04-26
Posts: 11

Re: [SOLVED] Fcron fails to start

Both paths start firefox in konsole. However, firefox was just used to test that fcron was running. To avoid getting sidetracked by any peculiarities to starting firefox, I instead tried adding:

01 * * * * /bin/echo Hello, world!

As per the axample in https://wiki.archlinux.org/index.php/Cron

...but still no effect after running systemctl start fcron

Offline

#8 2017-11-14 13:07:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,868

Re: [SOLVED] Fcron fails to start

What do you expect "echo Hello, World" to do?
Do you edit the users or the roots crontab?

Offline

#9 2017-11-14 13:14:27

eeenilsson
Member
Registered: 2017-04-26
Posts: 11

Re: [SOLVED] Fcron fails to start

I guess it should print the message in konsole?

I use fcrontab -e to edit the crontab. How do I know if it is users or root crontab? It seems to be created in /tmp/ when i first run fcrontab -e

Last edited by eeenilsson (2017-11-14 13:17:09)

Offline

#10 2017-11-14 13:27:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,868

Re: [SOLVED] Fcron fails to start

eeenilsson wrote:

I guess it should print the message in konsole?

Why? And which konsole in particular?
It'll print to the stdout of the fcron job ...

/bin/bash -c 'echo test > /tmp/fcron.test'

I use fcrontab -e to edit the crontab. How do I know if it is users or root crontab?

It's the one of the calling user - "whoami"

Offline

#11 2017-11-14 13:44:12

eeenilsson
Member
Registered: 2017-04-26
Posts: 11

Re: [SOLVED] Fcron fails to start

I got this to work using cronie instead of fcron: 08 13 * * * env DISPLAY=:0 /usr/bin/firefox

Offline

#12 2017-11-14 13:49:09

eeenilsson
Member
Registered: 2017-04-26
Posts: 11

Re: [SOLVED] Fcron fails to start

Thanks for the explanation!

In that case it was the user crontab I used.

I got this to work using cronie instead of fcron: 48 13 * * * env DISPLAY=:0 /usr/bin/firefox

Possibly I was missing a blank line at the end of the crontab when using fcrontab - Cronie gave a warning but fcron did not when blank line was omitted.

Will try to make some more testing with fcron when I have the time.

Last edited by eeenilsson (2017-11-14 13:51:35)

Offline

#13 2017-11-14 14:09:09

eeenilsson
Member
Registered: 2017-04-26
Posts: 11

Re: [SOLVED] Fcron fails to start

I got this to work on fcron also.

To summarize:

1. Install fcron
2. > systemctl enable fcron
3. > systemctl start fcron
4. > fcrontab -e

Put the following in crontab:

*/1 * * * * /bin/bash -c 'echo test > /tmp/fcron.test'

Remember to add a blank line to the end of the crontab file!

This created the file "fcron.test" in the /tmp/ directory.

To start firefox the disply option should be used:

*/20 * * * * DISPLAY=:0.0 /usr/lib/firefox/firefox


Thanks to Seth and the others helping out!

Last edited by eeenilsson (2017-11-14 14:10:39)

Offline

Board footer

Powered by FluxBB