Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need to open one (or more) browser tab periodically and I decided to use cron.

The command in the shell (bash) that correctly executes this task is chromium-browser http://mysite.com. If I type it, the browser opens the site in a tab.

But the same command inserted as a task in the crontable doesn't work.

If I redirect the output of other simple commands in the crontable in a file they work correctly, say

echo "hello world" > /home/user/file

So, shall I redirect the output of the command chromium-browser http://mysite.com to my graphic interface? If yes, which would be the device?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

i added the following to my crontab by typing crontab -e and it worked

* * * * * env DISPLAY=:0 google-chrome www.github.com

My chrome browser opened www.github.com every minute. So the following should work for you.

* * * * * env DISPLAY=:0 chromium-browser http://mysite.com
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.