How to start a GUI application from cron?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I need to run a Java applet from a Firefox. The problem is, I need to run this Firefox from a cron. If I run from the command line and its work fine, but when put the command in the cron it failed:
*/1 * * * * firefox http://domain.com/iqms/packetloss/iqmspacket2.html
firefox java cron
add a comment |
I need to run a Java applet from a Firefox. The problem is, I need to run this Firefox from a cron. If I run from the command line and its work fine, but when put the command in the cron it failed:
*/1 * * * * firefox http://domain.com/iqms/packetloss/iqmspacket2.html
firefox java cron
1
You can use Selenium's java library if you need more functions than just opening it.
– Övünç Metin
Aug 21 '14 at 14:08
You can also use Selenium with python, which is easier for scripts.
– ESala
Nov 24 '15 at 13:17
add a comment |
I need to run a Java applet from a Firefox. The problem is, I need to run this Firefox from a cron. If I run from the command line and its work fine, but when put the command in the cron it failed:
*/1 * * * * firefox http://domain.com/iqms/packetloss/iqmspacket2.html
firefox java cron
I need to run a Java applet from a Firefox. The problem is, I need to run this Firefox from a cron. If I run from the command line and its work fine, but when put the command in the cron it failed:
*/1 * * * * firefox http://domain.com/iqms/packetloss/iqmspacket2.html
firefox java cron
firefox java cron
edited Mar 14 '15 at 14:46
Jacob Vlijm
66.7k9137234
66.7k9137234
asked Aug 21 '14 at 9:30
fadabi Nawifadabi Nawi
1411110
1411110
1
You can use Selenium's java library if you need more functions than just opening it.
– Övünç Metin
Aug 21 '14 at 14:08
You can also use Selenium with python, which is easier for scripts.
– ESala
Nov 24 '15 at 13:17
add a comment |
1
You can use Selenium's java library if you need more functions than just opening it.
– Övünç Metin
Aug 21 '14 at 14:08
You can also use Selenium with python, which is easier for scripts.
– ESala
Nov 24 '15 at 13:17
1
1
You can use Selenium's java library if you need more functions than just opening it.
– Övünç Metin
Aug 21 '14 at 14:08
You can use Selenium's java library if you need more functions than just opening it.
– Övünç Metin
Aug 21 '14 at 14:08
You can also use Selenium with python, which is easier for scripts.
– ESala
Nov 24 '15 at 13:17
You can also use Selenium with python, which is easier for scripts.
– ESala
Nov 24 '15 at 13:17
add a comment |
2 Answers
2
active
oldest
votes
Cron runs in an environment that knows nothing about the display manager ($DISPLAY
isn't set). Your terminal window that you've been testing in has this set for it. If you tried it in a "real" terminal, or over SSH, you'd see it break.
If you've only got one X server running, just specifying the display might work:
* * * * * DISPLAY=:0 firefox ...
You could probably put more effort into working out what display it's sitting under rather than assuming it's :0
but that will probably work most of the time.
If you just need to reload something a lot, look at Tab Auto Reload or similar Firefox plugins.
I found this answer but still does not start the firefox. After a few search, I found that i need to run as a valid user instead from root. * * * * * "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html"
– fadabi Nawi
Aug 22 '14 at 0:35
1
@fadabiNawi An easier way of managing that would be to install the cron line into the correct user's crontab. Log in as who you want, andcrontab -e
– Oli♦
Aug 22 '14 at 6:56
add a comment |
I found this answer i am looking for addition to oli's :
After a few search, I found that i need to run as a valid user instead from root.
* * * * * su fadabi -c "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html";
tq
This helped, thanks a lot! Just a note: full path to Firefox is mandatory, I didn't realise that and it didn't work
– aexl
Jul 27 '18 at 7:28
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f514167%2fhow-to-start-a-gui-application-from-cron%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Cron runs in an environment that knows nothing about the display manager ($DISPLAY
isn't set). Your terminal window that you've been testing in has this set for it. If you tried it in a "real" terminal, or over SSH, you'd see it break.
If you've only got one X server running, just specifying the display might work:
* * * * * DISPLAY=:0 firefox ...
You could probably put more effort into working out what display it's sitting under rather than assuming it's :0
but that will probably work most of the time.
If you just need to reload something a lot, look at Tab Auto Reload or similar Firefox plugins.
I found this answer but still does not start the firefox. After a few search, I found that i need to run as a valid user instead from root. * * * * * "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html"
– fadabi Nawi
Aug 22 '14 at 0:35
1
@fadabiNawi An easier way of managing that would be to install the cron line into the correct user's crontab. Log in as who you want, andcrontab -e
– Oli♦
Aug 22 '14 at 6:56
add a comment |
Cron runs in an environment that knows nothing about the display manager ($DISPLAY
isn't set). Your terminal window that you've been testing in has this set for it. If you tried it in a "real" terminal, or over SSH, you'd see it break.
If you've only got one X server running, just specifying the display might work:
* * * * * DISPLAY=:0 firefox ...
You could probably put more effort into working out what display it's sitting under rather than assuming it's :0
but that will probably work most of the time.
If you just need to reload something a lot, look at Tab Auto Reload or similar Firefox plugins.
I found this answer but still does not start the firefox. After a few search, I found that i need to run as a valid user instead from root. * * * * * "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html"
– fadabi Nawi
Aug 22 '14 at 0:35
1
@fadabiNawi An easier way of managing that would be to install the cron line into the correct user's crontab. Log in as who you want, andcrontab -e
– Oli♦
Aug 22 '14 at 6:56
add a comment |
Cron runs in an environment that knows nothing about the display manager ($DISPLAY
isn't set). Your terminal window that you've been testing in has this set for it. If you tried it in a "real" terminal, or over SSH, you'd see it break.
If you've only got one X server running, just specifying the display might work:
* * * * * DISPLAY=:0 firefox ...
You could probably put more effort into working out what display it's sitting under rather than assuming it's :0
but that will probably work most of the time.
If you just need to reload something a lot, look at Tab Auto Reload or similar Firefox plugins.
Cron runs in an environment that knows nothing about the display manager ($DISPLAY
isn't set). Your terminal window that you've been testing in has this set for it. If you tried it in a "real" terminal, or over SSH, you'd see it break.
If you've only got one X server running, just specifying the display might work:
* * * * * DISPLAY=:0 firefox ...
You could probably put more effort into working out what display it's sitting under rather than assuming it's :0
but that will probably work most of the time.
If you just need to reload something a lot, look at Tab Auto Reload or similar Firefox plugins.
answered Aug 21 '14 at 9:54
Oli♦Oli
225k90567768
225k90567768
I found this answer but still does not start the firefox. After a few search, I found that i need to run as a valid user instead from root. * * * * * "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html"
– fadabi Nawi
Aug 22 '14 at 0:35
1
@fadabiNawi An easier way of managing that would be to install the cron line into the correct user's crontab. Log in as who you want, andcrontab -e
– Oli♦
Aug 22 '14 at 6:56
add a comment |
I found this answer but still does not start the firefox. After a few search, I found that i need to run as a valid user instead from root. * * * * * "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html"
– fadabi Nawi
Aug 22 '14 at 0:35
1
@fadabiNawi An easier way of managing that would be to install the cron line into the correct user's crontab. Log in as who you want, andcrontab -e
– Oli♦
Aug 22 '14 at 6:56
I found this answer but still does not start the firefox. After a few search, I found that i need to run as a valid user instead from root. * * * * * "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html"
– fadabi Nawi
Aug 22 '14 at 0:35
I found this answer but still does not start the firefox. After a few search, I found that i need to run as a valid user instead from root. * * * * * "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html"
– fadabi Nawi
Aug 22 '14 at 0:35
1
1
@fadabiNawi An easier way of managing that would be to install the cron line into the correct user's crontab. Log in as who you want, and
crontab -e
– Oli♦
Aug 22 '14 at 6:56
@fadabiNawi An easier way of managing that would be to install the cron line into the correct user's crontab. Log in as who you want, and
crontab -e
– Oli♦
Aug 22 '14 at 6:56
add a comment |
I found this answer i am looking for addition to oli's :
After a few search, I found that i need to run as a valid user instead from root.
* * * * * su fadabi -c "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html";
tq
This helped, thanks a lot! Just a note: full path to Firefox is mandatory, I didn't realise that and it didn't work
– aexl
Jul 27 '18 at 7:28
add a comment |
I found this answer i am looking for addition to oli's :
After a few search, I found that i need to run as a valid user instead from root.
* * * * * su fadabi -c "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html";
tq
This helped, thanks a lot! Just a note: full path to Firefox is mandatory, I didn't realise that and it didn't work
– aexl
Jul 27 '18 at 7:28
add a comment |
I found this answer i am looking for addition to oli's :
After a few search, I found that i need to run as a valid user instead from root.
* * * * * su fadabi -c "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html";
tq
I found this answer i am looking for addition to oli's :
After a few search, I found that i need to run as a valid user instead from root.
* * * * * su fadabi -c "DISPLAY=:0.0 /usr/bin/firefox -new-window x.com/iqms/packetloss/iqmspacket2.html";
tq
answered Aug 22 '14 at 0:44
fadabi Nawifadabi Nawi
1411110
1411110
This helped, thanks a lot! Just a note: full path to Firefox is mandatory, I didn't realise that and it didn't work
– aexl
Jul 27 '18 at 7:28
add a comment |
This helped, thanks a lot! Just a note: full path to Firefox is mandatory, I didn't realise that and it didn't work
– aexl
Jul 27 '18 at 7:28
This helped, thanks a lot! Just a note: full path to Firefox is mandatory, I didn't realise that and it didn't work
– aexl
Jul 27 '18 at 7:28
This helped, thanks a lot! Just a note: full path to Firefox is mandatory, I didn't realise that and it didn't work
– aexl
Jul 27 '18 at 7:28
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f514167%2fhow-to-start-a-gui-application-from-cron%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You can use Selenium's java library if you need more functions than just opening it.
– Övünç Metin
Aug 21 '14 at 14:08
You can also use Selenium with python, which is easier for scripts.
– ESala
Nov 24 '15 at 13:17