I have written a chrome extension that performs a task whenever it is available, and for that I would need the chrome browser open at all times. My idea was to have a check say every minute if the google process is running if not start chrome. I have added the following in my users crontab (I'm running Ubuntu 14.04)

* * * * * export DISPLAY=:0 && if ! ps aux | grep -q "[c]hrome"; then google-chrome; fi

However nothing seems to run, did i miss out on anything?

2 Answers 2


The enviroment that you get for a cronjob is very limited. For example, you don't get the DISPLAY variable which is required to open chrome.

Instead of google-chrome use /opt/google/chrome/chrome


The main problem with this kind of user-crontab entry is that it needs bash to be able to run.

So the easiest way is to create a small bash-script like /home/dylanfa88/keep-chrome-running and put this in your user-crontab.

* * * * * /bin/bash /home/dylanfa88/keep-chrome-running

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .