50
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 ...
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 -...
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 ...
12
votes
Open chromium full screen on start up
on chromium you can use --start-fullscreen (like F11)
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.
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 ...
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 ...
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 ...
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 ...
6
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
5
votes
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 ...
5
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 ...
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 ...
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, ...
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"
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 ...
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 ...
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 ...
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. ...
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
3
votes
How to move mouse pointer to a specific location on the screen AT BOOT?
The file /home/pi/.config/lxsession/LXDE-pi/autostart includes the line @point-rpi
Description for point-rpi is:
Locate the mouse pointer over the menu button
This tool determines the current ...
3
votes
Get Bash instead of /bin/sh in a VNC session started by cron
I was able to fix the issue by adding following line in my ~/.vnc/xstartup :
export SHELL=/bin/bash
3
votes
Accepted
Create ssh tunnel on startup
/usr/bin/ssh -i /home/user/.ssh/id_rsa -N -R 4445:localhost:22 user@hostname &
You start the process in the background, which is always successful regardless the result. You should use -f switch ...
3
votes
How do I reboot at a specific time?
I've found other answers here to be incomplete or have bugs. This is a more complete answer that addresses problems I found with other answers and contains information about how to do debugging.
Cron ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cron × 256python × 67
raspbian × 56
boot × 23
bash × 19
python-3 × 15
script × 13
pi-3 × 11
raspberry-pi-os-buster × 11
ssh × 8
linux × 8
reboot × 8
gpio × 7
raspbian-stretch × 7
python-2.x × 6
usb × 5
pi-3b+ × 5
shutdown × 5
networking × 4
pi-2 × 4
pi-4 × 4
audio × 4
display × 4
raspbian-jessie × 4
vnc × 4