Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Crontab for Firefox

  1. #1

    Default Crontab for Firefox

    I wrote in crontab:

    */1 * * * * export DISPLAY=:0 && /home/niklas/Desktop/firefox.sh

    but then there is always the message:
    No protocol specified
    No protocol specified
    Error: cannot open display: :0

    in /var/spool/mail/username

    What did I wrong?
    http://www.vic-fontaine.com/

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,822

    Default Re: Crontab for Firefox

    Is what you show the ouput of
    Code:
    crontab -l
    Code:
    export DISPLAY=:0 && /home/niklas/Desktop/firefox.sh
    This is a bit strange (I a still doubting what this does) . Should be:
    Code:
    DISPLAY=:0 /home/niklas/Desktop/firefox.sh
    In who's crontab? Only the user that is using Diaplay :0 may open a window (without further allowance).

    What is the executable firefox.sh supposed to do? I can make a guess, but guessing is dangerous in a computer envirinment. One must be certain. so what about the ouput of
    Code:
    cat  /home/niklas/Desktop/firefox.sh
    (when it is not to long).
    Henk van Velden

  3. #3

    Default Re: Crontab for Firefox

    in the firefox.sh is just a link to a website, that should be opened
    like this:

    Code:
    firefox http://www.chip.de/
    I think it is in the crontab of the user because I did it from the console, after I logged in as my user
    http://www.vic-fontaine.com/

  4. #4

    Default Re: Crontab for Firefox

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Agreed on all points. What is your real goal? The */1 is redundant and
    should just be * as it means the same thing. The use of 'export' and '&&'
    is redundant and can be simplified to what was shown. Also loading
    Firefox every single minute seems a little bit crazy if that is what youa
    re doing, which is why I ask what you are doing. If you want something
    GUI-ish loaded you also need to, as mentioned previously, allow that from
    the GUI side as the user running the X session with something like
    'xhost'. The general open-it-up-for-everybody method that you should
    probably not use (but which works in any case) is 'xhost +' but, again,
    you should probably be a bit more restrictive than that if you allow
    anybody on your machine besides yourself. If you are just hoping to have
    Firefox always loaded that is fine but if you are trying to pull down
    files or hit a page every minute there are much better ways to do that
    with things like 'wget' and 'curl' which are already on your machine in
    most cases.

    Good luck.





    hcvv wrote:
    > Is what you show the ouput of
    >
    > Code:
    > --------------------
    > crontab -l
    > --------------------
    >
    >
    >
    > Code:
    > --------------------
    > export DISPLAY=:0 && /home/niklas/Desktop/firefox.sh
    > --------------------
    >
    > This is a bit strange (I a still doubting what this does) . Should be:
    >
    > Code:
    > --------------------
    > DISPLAY=:0 /home/niklas/Desktop/firefox.sh
    > --------------------
    >
    >
    > In who's crontab? Only the user that is using Diaplay :0 may open a
    > window (without further allowance).
    >
    > What is the executable firefox.sh supposed to do? I can make a guess,
    > but guessing is dangerous in a computer envirinment. One must be
    > certain. so what about the ouput of
    >
    > Code:
    > --------------------
    > cat /home/niklas/Desktop/firefox.sh
    > --------------------
    >
    > (when it is not to long).
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQIcBAEBAgAGBQJK2ev7AAoJEF+XTK08PnB5fckQANIL3MX+dMfXOBEhzJQNfSLD
    rJawRcn6hu75P8qBckP9jnkYWeMuOMTGcvqTcT73exKP5JFijuQHREUtotIcrT0t
    xFQLUo8R7XIgxPZsNTAbdOu2lbnCjld3EYZs/8hgRY66B/NgMuLwaZ5V/+vBBI9n
    j6dKJwuaaUiFCFyptw+BS4UShhYde+RRx5sbBKuYa7L8FcWpfR4r5+DQb6h/jzsW
    Vaun0nli/Ip8JM4mePe3NfZ7dkFc6sP/QqLozzD3UbeEOU+C46TszIEvJXCW3/5l
    BZyRN5JrDzyAM3/do2MLxEmdPuERVg7DkoAf7RUC9/GI9S1vKMlP+odxXEtdey0a
    Cv7n7t64QVObri06pxid8w1+VtNLOqJo/zgzd8r1OCyocnUDoum7t104Ss1ofJfi
    MdtWA2v0Apv7l1ebqBjs/O0HLpEbtNC6NWvN6PglpUjJ4CTxlWq2VRJH85pj0Nv6
    9F+QD8sdzu8PzK+wh2lWu3SkpS+basFcL2l6L4EF2PqM+HfoqbraMS160toNh1sR
    N2/LW90wwuok2+SRSyzsZsz+mi7DpsMk1IVNvm9ejWt5ELl34f3Xqo/FZ/q3DlyR
    0lxvZnimB8ZbvStcmo1p6hcejPXiBVpxnMAvBkdc1x4CzPtb31kQGb9Mt/CbileE
    E9/Po5RlEorAw9tB9fKB
    =5a9m
    -----END PGP SIGNATURE-----

  5. #5

    Default Re: Crontab for Firefox

    Now I have written the content of the firefox.sh in the crontab.
    Now it looks like:

    Code:
    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (/tmp/tmp4Aly0H installed on Sat Oct 17 18:07:54 2009)
    # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
    */1 * * * * DISPLAY=:0 firefox http://www.chip.de/ # JOB_ID_2
    Still the same error.
    http://www.vic-fontaine.com/

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,822

    Default Re: Crontab for Firefox

    Quote Originally Posted by buugmenot View Post
    Now I have written the content of the firefox.sh in the crontab.
    Now it looks like:

    Code:
    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (/tmp/tmp4Aly0H installed on Sat Oct 17 18:07:54 2009)
    # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
    */1 * * * * DISPLAY=:0 firefox http://www.chip.de/ # JOB_ID_2
    Still the same error.
    That proves that you are doing the same thing as before, but you have short cutted a few things, which is always good because it makes things clearer.

    As you post is only 4 minutes after the one from ab@novell.com is suppose you did not do the xhost + in your running GUI. You should also think about all his remarks about starting FF every minute.
    Henk van Velden

  7. #7

    Default Re: Crontab for Firefox

    That with /1 was just an example.
    Yes curl seems to be working, but I want to know how to start a GUI programm all the same.
    xhost +myusername
    then appears:
    bad hostname: my username
    http://www.vic-fontaine.com/

  8. #8
    Join Date
    Jul 2008
    Location
    Voorhout, Netherlands
    Posts
    262

    Default Re: Crontab for Firefox

    ab@novell.com wrote:
    > Agreed on all points. What is your real goal? The */1 is redundant and
    > should just be * as it means the same thing. The use of 'export' and '&&'
    > is redundant and can be simplified to what was shown. Also loading
    > Firefox every single minute seems a little bit crazy if that is what youa
    > re doing, which is why I ask what you are doing. If you want something


    I would guess that the OP tries to reload this website in a 60sec interval.
    The solution is simple: get the 'ReloadEvery' plugin for Ff.
    Ff can be auto-loaded when you log-in of course, so the whole process is
    without user interaction.

    Theo

  9. #9

    Default Re: Crontab for Firefox

    Now there is just the question how to start a grafical program in general
    http://www.vic-fontaine.com/

  10. #10
    Join Date
    Jul 2008
    Location
    Voorhout, Netherlands
    Posts
    262

    Default Re: Crontab for Firefox

    buugmenot wrote:
    > Now there is just the question how to start a grafical program in
    > general
    >
    >


    Read this please.
    http://www.catb.org/~esr/faqs/smart-questions.html

    Without telling what you try to accomplish your question doesn't
    make sense, as it's unlikely you want to hear the obvious answer.

    Theo

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •