How can I automatically refresh a page every X minutes?
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
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.
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 -->
Closing if no answer
the simplest way I found is to schedule a cronjob to execute the refresh script in /home/pi/scripts. works fine for me..
The best way to do this would be:
- run
crontab -e - 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
Thanks guys.
+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.
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
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?
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...

It's not pointing to the FullPageDashboard
Any help would be greatly appreciated, thank you!
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
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.
but it is a dirty solution.
Actually not, it cleans out any possible memory leaks.
It could be added to the FAQ wiki page in this repo if you want to add it :)
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 -ethen 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"
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.
I made simple Chrome extension which refreshes web page every 5 minutes. https://github.com/tapio80/Refresh-Page