FullPageOS icon indicating copy to clipboard operation
FullPageOS copied to clipboard

How can I automatically refresh a page every X minutes?

Open zapatacez opened this issue 9 years ago • 18 comments

I looked around the distro and I could not find a good way to make Chromium refresh the page every x minutes.

Any scripts or will the new version have this capability?

Not using FullPageDashboard. Using version 6

zapatacez avatar Apr 30 '17 21:04 zapatacez

You didn't find one because there is none. Also FullPageDashboard, the app that handles the refresh on FullPageOS is not maintained anymore. You could modify its source directly or use another dashboard app.

guysoft avatar May 10 '17 14:05 guysoft

Two ways, if you're just showing a html page then either

<script type="text/javascript">
  setTimeout(function () { location.reload(true); }, 30000); // 30 seconds
</script>

or via a meta tag

<meta http-equiv="Refresh" content="30"> <!-- 30 seconds -->

danielhampton avatar Jul 30 '17 10:07 danielhampton

Closing if no answer

guysoft avatar Aug 11 '17 14:08 guysoft

the simplest way I found is to schedule a cronjob to execute the refresh script in /home/pi/scripts. works fine for me..

tdusmoha avatar Oct 27 '17 19:10 tdusmoha

The best way to do this would be:

  1. run crontab -e
  2. Insert the following lines into the file:
# Refresh the page every 5 minutes, to keep running well
*/5 * * * * /home/pi/scripts/refresh &> /dev/null

EDIT:

Or, use the new safe_refresh script I added, which will be in next time the image is built. this reduces the likelyhood of refreshing to an error pg.

# Refresh the page every 5 minutes, to keep running well
*/5 * * * * /home/pi/scripts/safe_refresh &> /dev/null

benyanke avatar Jan 18 '18 15:01 benyanke

Thanks guys.

zapatacez avatar Jan 18 '18 15:01 zapatacez

+1 for documentation of this! Thanks for this! I use Pi for a viewer of zoneminder and have to refresh the page every so often to ensure everything runs smother.

Thanks!

Good to note this should be run as $USER not root.

colton22 avatar May 29 '18 15:05 colton22

Ive installed the crontab per documentation here:

Refresh the page every 5 minutes, to keep running well

*/5 * * * * /home/pi/scripts/safe_refresh &> /dev/null

However, it's not refeshing from what I can tell. Am I doing something else wrong? Do I need to enable anything else to get it to work? I can see the scripts, so I know I'm using a build with them in it.

Thanks

scfigg avatar Feb 23 '21 15:02 scfigg

try sending the output from /dev/null to /tmp.refresh.log and see if that is outputting anything. Also - by documentation you mean this issue right?

guysoft avatar Mar 01 '21 16:03 guysoft

Hi,

I've run crontab -e

I've then added in

# Refresh the page every 5 minutes, to keep running well
*/5 * * * * /home/pi/scripts/safe_refresh &> /dev/null

Unfortunately it's not refreshing the browser, is there something I've missed?

I originally came here: https://github.com/guysoft/FullPageOS

Selected the link to the mirror (http://unofficialpi.org/Distros/FullPageOS/) and then downloaded the zip... image

It's not pointing to the FullPageDashboard

Any help would be greatly appreciated, thank you!

WDazed avatar May 10 '22 08:05 WDazed

Ok, so this was doing my absolute head in. Thanks to @George-Britton I finally have it working!!

We used:

cd /home/pi/scripts

sudo chmod -R 777 /home

cp safe_refresh /home/safe_refresh

cd /home

crontab -e

then added in:

*/5 * * * * /home/safe_refresh &> /dev/null

WDazed avatar May 23 '22 12:05 WDazed

Sorry to comment an old thread, but i still have an issue

Okay for refreshing, the script under /home/pi/script/refresh is working good

But i need to go back to the main page defined in /boot/fullpageos.txt

I have some user interaction on my dashboard, i want to go to the main page every hour because the user can change tab. How to don that? Refresh is not enough in my case

actually i am doing

0 */1 * * * /usr/bin/killall /usr/lib/chromium-browser/chromium-browser

but it is a dirty solution.

blastbeng avatar Nov 09 '22 19:11 blastbeng

but it is a dirty solution.

Actually not, it cleans out any possible memory leaks.

ethaniel avatar Dec 13 '23 13:12 ethaniel

It could be added to the FAQ wiki page in this repo if you want to add it :)

guysoft avatar Jan 15 '24 13:01 guysoft

Ok, so this was doing my absolute head in. Thanks to @George-Britton I finally have it working!!

We used:

cd /home/pi/scripts

sudo chmod -R 777 /home

cp safe_refresh /home/safe_refresh

cd /home

crontab -e

then added in:

*/5 * * * * /home/safe_refresh &> /dev/null

I used these commands but it never refreshes. The log file says "/bin/sh: 1: /home/safe_refresh: Permission denied"

pengytek avatar Nov 18 '24 15:11 pengytek

I used these commands but the it never refreshes. The log file says "/bin/sh: 1: /home/safe_refresh: Permission denied"

You forgot chmod 755 /home/safe_refresh which makes safe_refresh executable.

ethaniel avatar Nov 18 '24 15:11 ethaniel

I made simple Chrome extension which refreshes web page every 5 minutes. https://github.com/tapio80/Refresh-Page

tapio80 avatar Mar 02 '25 02:03 tapio80

Hi,

I had the same problem on my kiok using FullPageOS, I solved the problem using @pengytek and @ethaniel solutions.

cd /home/pi/scripts

sudo chmod -R 777 /home

cp safe_refresh /home/safe_refresh

cd /home

crontab -e


then added in:


*/5 * * * * /home/safe_refresh &> /dev/null


Save file


chmod 755 /home/safe_refresh

Thanks a lot.

JAUBERT1977 avatar May 10 '25 07:05 JAUBERT1977