|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc. |
![]() |
|
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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/ |
|
|||
|
in the firefox.sh is just a link to a website, that should be opened
like this: Code:
firefox http://www.chip.de/
__________________
http://www.vic-fontaine.com/ |
|
|||
|
-----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+dM fXOBEhzJQNfSLD rJawRcn6hu75P8qBckP9jnkYWeMuOMTGcvqTcT73exKP5JFiju QHREUtotIcrT0t xFQLUo8R7XIgxPZsNTAbdOu2lbnCjld3EYZs/8hgRY66B/NgMuLwaZ5V/+vBBI9n j6dKJwuaaUiFCFyptw+BS4UShhYde+RRx5sbBKuYa7L8FcWpfR 4r5+DQb6h/jzsW Vaun0nli/Ip8JM4mePe3NfZ7dkFc6sP/QqLozzD3UbeEOU+C46TszIEvJXCW3/5l BZyRN5JrDzyAM3/do2MLxEmdPuERVg7DkoAf7RUC9/GI9S1vKMlP+odxXEtdey0a Cv7n7t64QVObri06pxid8w1+VtNLOqJo/zgzd8r1OCyocnUDoum7t104Ss1ofJfi MdtWA2v0Apv7l1ebqBjs/O0HLpEbtNC6NWvN6PglpUjJ4CTxlWq2VRJH85pj0Nv6 9F+QD8sdzu8PzK+wh2lWu3SkpS+basFcL2l6L4EF2PqM+Hfoqb raMS160toNh1sR N2/LW90wwuok2+SRSyzsZsz+mi7DpsMk1IVNvm9ejWt5ELl34f3Xq o/FZ/q3DlyR 0lxvZnimB8ZbvStcmo1p6hcejPXiBVpxnMAvBkdc1x4CzPtb31 kQGb9Mt/CbileE E9/Po5RlEorAw9tB9fKB =5a9m -----END PGP SIGNATURE----- |
|
|||
|
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
__________________
http://www.vic-fontaine.com/ |
|
||||
|
Quote:
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 |
|
|||
|
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/ |
|
|||
|
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 |
|
|||
|
Now there is just the question how to start a grafical program in general
__________________
http://www.vic-fontaine.com/ |
|
|||
|
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 |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|