Skip to main content
Share Your Experience: Take the 2024 Developer Survey
47 votes

Open chromium full screen on start up

Edit this file sudo nano /etc/xdg/lxsession/LXDE-pi/autostart And add this: @xset s off @xset -dpms @xset s noblank @chromium-browser --kiosk http://google.com/ # load chromium after boot and open ...
SK73106's user avatar
  • 611
16 votes

Why is cron needed for Raspbian?

In Unix/Linux systems, lots of OS background tasks are run as cron jobs. To see what won't run if you stop the cron daemon, type these commands: ls -la /etc/cron.hourly ls -la /etc/cron.daily ls -...
Michael Harvey's user avatar
14 votes

Is there a way to remove old files without relying on internet time service?

Since you don't have Internet NTP, the file timestamps are meaningless, being reset to the Pi's "/etc/fake-hwclock.data" time whenever the system is booted. If the daily data file(s) have a ...
dave58's user avatar
  • 345
11 votes

Open chromium full screen on start up

on chromium you can use --start-fullscreen (like F11)
Quadrifoglio Verde's user avatar
10 votes

Why is cron needed for Raspbian?

cron runs tasks (system or user chosen) which need to be run at regular intervals. By itself it uses negligible resources. I suggest you leave cron alone.
joan's user avatar
  • 71.1k
9 votes

Execute a script at sunrise/sunset

If you want to run cron jobs with start times relative to sun up/down or twilight then you could use sunwait It will determine the correct time to wait, based on your location's coordinates. Simple ...
Dirk's user avatar
  • 3,541
8 votes
Accepted

cron not executing python3

As is typical with crontab issues. The environment is not the same as your user or even a sudo/root shell , and env python3 may not return anything (env simply searches through Instead you should ...
crasic's user avatar
  • 3,003
7 votes

Is there a way to remove old files without relying on internet time service?

On a system where the time resets on boot, you can't know what time it is when the system starts, and similarly can't know how long it was when the system was down. But you can count reboots, and you ...
ilkkachu's user avatar
  • 213
6 votes
Accepted

How to automatically run a Python GPIO script at boot?

The easiest way to have something run at boot is via /etc/rc.local. Some systemd based distros (e.g., Arch and Fedora) have stopped including this, although it is easy to implement. Which doesn't ...
goldilocks's user avatar
  • 59.1k
6 votes
Accepted

Is it necessary to release Raspberry Pi Camera before rebooting? If so how do I do it?

There is NO NEED to do anything before a reboot. If you issue a sudo reboot command Linux will manage an orderly shutdown of the software. This is, however, a poor way of ensuring a reliable 24/7 ...
Milliways's user avatar
  • 60.3k
6 votes
Accepted

What is the environment for cron?

We can ask cron to tell us what its environment is. Create a shell script in your home directory (~/) as follows (or with the editor of your choice): $ nano ~/envtst.sh Enter/C+P the following in ...
Seamus's user avatar
  • 22.2k
6 votes

What's different about a crontab reboot?

As I understand your question: You have a cron job to reboot your RPi every night at 01:00; e.g. 0 1 * * * sudo reboot (#or something similar; e.g. shutdown -r now) You have a 2nd cron job to ...
Seamus's user avatar
  • 22.2k
6 votes
Accepted

Is there a way to remove old files without relying on internet time service?

Raspbian includes fake-hwclock, which saves the clock to the SD card on shutdown and restores it on boot. However, if you're just cutting the power to restart it, this is fairly useless; it will never ...
wizzwizz4's user avatar
  • 186
5 votes

Launch Python script from Cron in foreground

To run in foreground you'd need to add DISPLAY=:0: @reboot DISPLAY=:0 \usr\bin\python3 \home\pi\Desktop\photo_frames\get_random_row.py > /logs/cronlog Or open it explicitly with xterm: @reboot ...
techraf's user avatar
  • 4,329
5 votes
Accepted

Raspbian Jessie "wait for network" Vs. Cron @reboot entries

will the entire system halt until the network is up No. where in the boot-up sequence is crontab activated? Crontabs are managed by cron, a system daemon started by init, which on Raspbian jessie ...
goldilocks's user avatar
  • 59.1k
5 votes

Execute a script at sunrise/sunset

I tried sunwait, mentioned above, but found it to be a bit clunky. I rewrote a similar program, myself, called heliocron, with the advantages being that it is actively maintained, has clear ...
Michael Freeborn's user avatar
5 votes

Why is cron needed for Raspbian?

Cron is actually very useful. Say you wanted to run a program once a day, then cron is your friend. You can schedule to run a program at any time during the day. I would definitely leave it on your ...
UNKNOWN's user avatar
  • 79
5 votes
Accepted

Can't run python script on startup. Raspberry Pi 4

You've run into a well-known limitation with cron. The question has been asked and answered here many times. This recent example highlights the two (at least two) choices you have: use cron (older, ...
Seamus's user avatar
  • 22.2k
4 votes

Where do Cron error message go?

Crontab has several parameters (in additional to time execution lines) For example: MAILTO="[email protected]" SHELL="/bin/bash"
DGerman's user avatar
  • 41
4 votes
Accepted

Get Bash instead of /bin/sh in a VNC session started by cron

It seems like the problem originates form cron using /bin/sh and not the users SHELL default. I found other people having the same problem at Default shell for cron issue How to change cron shell (sh ...
Frank Breitling's user avatar
4 votes
Accepted

What's wrong with this little python script?

You never flush the buffer, thus, the info is not being dumped to the file. This is done when the file is closed (you never do it), assigning a buffer size (see this stackoverflow answer and comments ...
XiR_'s user avatar
  • 78
4 votes
Accepted

Cronjob is missing the GET parameter in Raspberry Pi

The problem is that cron doesn't wait for your network to come up before it runs @reboot. The explanation as to why cron operates this way, and alternatives to cron are verbose, but have all been ...
Seamus's user avatar
  • 22.2k
4 votes
Accepted

Automatic shutdown of Pi based on timer

You've made a couple of mistakes, all par for the course. Let's step through this, get it working, and hopefully learn one other trick to help you help yourself in the future: First, the "other ...
Seamus's user avatar
  • 22.2k
4 votes

Crontab suddenly doesn't start jobs

You can help yourself by collecting any error messages that are generated when cron runs your scripts. As you're aware, your shell will send error messages to the stderr stream when they occur. When ...
Seamus's user avatar
  • 22.2k
4 votes
Accepted

CRON schedule to run a .py file

I think you are missing a shebang in the beginning of your python script. Please write #!/usr/bin/env python for python2 or #!/usr/bin/env python3 for python3 as a first line of your .py file. ...
kyjanond's user avatar
  • 231
4 votes

Is there a way to remove old files without relying on internet time service?

You could name your files sequentially and delete the oldest when there’s not much free space left use a larger SD card get the time by other means, for example GPS, DCF77 or RDS
Martin's user avatar
  • 143
3 votes
Accepted

Cron job not running ruby script

The problem was with my paths. Since I am using rvm with ruby I ran rvm cron setup from my working directory to setup my crontab. I then added the path to my directory to the PATH in crontab made ...
JanuskaE's user avatar
  • 131
3 votes

Raspberry Cron don't work

You should always use the full path when you don't know the execution environment. Use the full path to the php executable. Perhaps /usr/bin/php /var/www/TwitterBot-master/execute.php >> /var/...
joan's user avatar
  • 71.1k
3 votes

Code/Cron to detect low power and safe shutdown on GPIO

You can not rely on the 5V from the UBEC - because the UBEC is designed to maintain voltage even when input fails. It is not difficult to detect. Dry cells are effectively exhausted when the voltage ...
Milliways's user avatar
  • 60.3k

Only top scored, non community-wiki answers of a minimum length are eligible