Questions tagged [cron]
the job scheduler in Linux and other Unix-like operating systems. It enables users to schedule tasks to run non-interactively at specified intervals or predefined times, including upon reboot.
257 questions
0
votes
0
answers
22
views
How do I set up automatic authentication when using rsync pulling files from my raspberry pi to my wsl machine [closed]
I have currently set up the ssh connection. I have generated my passkey pair and saved the proper key to the authorized_key file in my .ssh directory and I have saved the key files to the wsl machine.
...
0
votes
1
answer
22
views
Starting python script in a virtual environment using cron
I have a Raspberrypi 5 running bookworm and would like to run a python script at reboot. The script is in a virtual environment: /home/mipi/venv/Startup/Startup.py (where venv is the root directory ...
-2
votes
1
answer
63
views
Scheduling a task with cron
I have digital signage software on raspberry Pi 4. It needs restarting 3 times a day to update menus. I have been looking into Cron jobs for this. I don't have any experience with Linux terminals and ...
0
votes
0
answers
33
views
Python - Way to interact with GUI by executing start - Raspian OS
I want to interact with the GUI of my display(Open an image every time I press a button that I have interfaced via GPIO) via a python script which is executed after bootup. (I have edited crontab file ...
0
votes
1
answer
55
views
Writing bash script to reboot pi 10 times and log output
I have written a Python script and scheduled it to run @reboot using cronjob. Sometimes this script throws an exception sometimes it works perfectly. I want to write test scripts for this.
Preferably, ...
-1
votes
1
answer
57
views
Python script started by crontab ends immediately
I'm trying to start a python script using crontab that runs in the background. I want to restart it every few hours, but for now I'm trying to test it every minute to make sure the crontab is working. ...
0
votes
1
answer
260
views
No sound with mpg123 or mplayer at boot
What I want to do : at boot, start a playlist on a headless RBPi A+ through the headphones jack using mpg123.
I Wrote a shell script targeting mpg123:
#!/bin/bash
# see if (and when) my script was run ...
0
votes
2
answers
63
views
Cronjob not executing when raspberry pi reboots
The following is the Python script that I want to execute every time Raspberry Pi reboots. When I run this Python script directly from the terminal it works. Not only does IP gets stored in the file ...
1
vote
2
answers
900
views
Reboot via `crontab` does not work on Raspberry Pi 4
I'm trying to configure a periodic reboot of my Raspberry Pi 4 via crontab (reboot every Wednesday and Sunday at midnight). However, the Raspi actually never reboots.
Here's a summary of my different ...
3
votes
0
answers
322
views
How can I reduce the memory usage of my python3 scripts on a Raspberry Pi Zero 2? [closed]
I created 9 python scripts that I run as cron jobs.
When I run them on a VirtualBox virtual machine running Ubuntu Server 20.04 with 512MB of RAM with a single processor, everything runs smoothly and ...
1
vote
1
answer
309
views
Playing audio with Python scrpitpt run from Cron
I have a USB sound card connecting mic & speakers to a Raspberry Pi Zero W +
The following script plays audio fine when run from the terminal. However, when run from cron, nothing can be heard.
...
1
vote
2
answers
477
views
Python script will not write out file when scheduled (cron or bash.rc)
I have a python script to record a .mp4 file with picamera2 which executes and save correctly when run through the editor (thonny) and through the terminal. However, when I schedule it through crontab ...
1
vote
0
answers
327
views
Retain persistent Wi-Fi connection on Raspberry Pi
I have a Raspberry Pi that I need it to remain connected to my WiFi constantly (at least as soon as the WiFI becomes available). In practice, however, I have noticed that when there are problems with ...
0
votes
3
answers
1k
views
Running Script on Crontab but it doesn't access WiFi connection
I am running a script using crontab at reboot but somehow the part of the code where some file is being sent to a S3 bucket in AWS, doesn't work. I have included an initial wifi check in the same ...
1
vote
0
answers
341
views
Fetch and pull git repo on boot
I have a cron job set up to run boot.sh on reboot, and log the input to debug.txt.
@reboot cd /home/<user>/code/seasons-pixel-clock/ && (sudo bash boot.sh) > debug.txt
The contents ...
0
votes
2
answers
487
views
python cv2 module not found when triggered by crontab
My python script imports cv2, and it works fine when I start the script manually.
If I set the script to launch on boot (either via crontab, or via a .desktop file (in the user/.config/autostart/...
-2
votes
1
answer
219
views
Running python script at reboot
On a headless raspberry pi I want to run a python script at reboot which continuous to run using tmux. From time to time I connect via ssh to get the data my python script collects.
All works fine ...
2
votes
1
answer
87
views
How to open PI for network traffic on a schedule [closed]
In an attempt to reduce risk to an IOT device I'd like it to enable wifi on a schedule, say only between 00:00 and 00:03 every day. Only just enough to upload a log file to my server, and then disable ...
1
vote
2
answers
256
views
Can't get Cron to run python script
I'm trying to set up porkbun dynamic dns python script to run at reboot via Cron (later I'd like to run it hourly, but baby steps...) following porkbun's tutorial https://www.youtube.com/watch?v=...
2
votes
0
answers
58
views
How can I get my python program that uses the requests library to run on boot via the crontab
I am working on creating a python script to retrieve data from a server using the requests library, and then display it on an adafruit led matrix using a raspberry pi. I have a program that functions ...
2
votes
3
answers
202
views
Cannot SSH into periphery RPis from master RPi using python script automated from crontab: Host key verification failed
Project Overview
I have a series of RPi 3B+ which collect T/RH data using connected sensors. These "periphery" units collect data every 5 minutes, append the data to a CSV file that holds a ...
0
votes
1
answer
2k
views
How to run libcamera-still in python trough crontab?
I'm trying to make a time lapse using crontab to manage time intervals. The camera I use is an arducam Autofocus imx519. The libcamera-still command works normally when run via terminal. But when I ...
1
vote
2
answers
845
views
Crontab can't create logs (Permission Denied)
I have a script that I want to run every hour, and the echo's of that script and other output, I want to be able to read.
Now when I take a look at /var/log/syslog, I see some weird stuff that I can't ...
0
votes
2
answers
223
views
Cronjob Raspberry Pi not working
I am trying to use my raspi to host a discord bot that every morning publishes the food in my school. I have setup a bronjob with crontab -e but it's not working.
Crontab lookis like this:
45 07 * 2-5 ...
0
votes
1
answer
179
views
BLE cannot scan after cloning Raspberry Pi 3
I have raspberry-pi 2 and i made a python program. My python program can detect BLE and send scan results using MQTT. The program will run automatically when restarted [Using cron-table]. Then I did ...
1
vote
0
answers
30
views
why won't my raspberry pi python program run at boot up? [duplicate]
i have recently bought a raspberry pi 4 module b to be able to run programs 24/7. but sometimes my power/electricity can go out at which then makes the program stop working.
i tested my program in the ...
2
votes
2
answers
702
views
Rotate display on startup
I try to rotate my display on startup. (Console, NOT X11)
I do not really care if this happens before the bootup-sequence or afterwards. As long as the display is rotated once the login-prompt appears ...
0
votes
0
answers
356
views
Start mono application on startup
This is my first time using a linux/rasbperry pie and I am trying to start a program I made in c# on my windows on startup. It has a graphical user interface, and can run from the command line using ...
1
vote
1
answer
123
views
.service or crontab for shell script calling python-CLI app and/or python script failing
This isn't necessarily a Pi-specific question, but might be applicable to general Linux. However, my hunch is that the Pi's uniqueness might have something to do with it.
I'm trying to run two scripts ...
0
votes
5
answers
2k
views
How to run a script (pointing to a python file) with root permission at startup in Raspberry Pi OS?
I am trying to run a script which ultimately runs a pagekite python file. The Pagekite offers tunnelling service for localhost to be publicly accessible. My aim is to run the pagekite.py when the Pi ...
0
votes
1
answer
90
views
Bash script wont run under sudo crontab but will under pi crontab
I have a simple script start_chromium.sh:
#!/bin/bash
DISPLAY=:0 chromium-browser --start-fullscreen --kiosk http://server:8080
When I do sudo crontab -e and add @reboot /home/pi/start_chromium.sh ...
0
votes
0
answers
97
views
Not Able to Change Volume with Cron (tried Python)
Alright, I've been trying this for several days and I'm just dying here...
I am putting together a kiosk that should play video. I'm using a NUC with Raspberry Pi Desktop. Everything works but ...
-1
votes
3
answers
1k
views
Cannot run a script after reboot using Cron
I'm trying to start a script containing cgminer for mining when the raspberry pi reboots however it doesn't.
My crontab contains the following.
@reboot sleep 120 && sudo /home/pi/StartVPN.sh
@...
0
votes
2
answers
46
views
python code to read SMS not working when running under cron
I made a python code to read SMS from SIM800 module, that is connected to a Raspberry Pi Zero W, and it is working like a charm when I run it on a terminal or another IDE.
Here is the expected result:
...
0
votes
1
answer
1k
views
Restart lxpanel through shell script; works in shell, but not in cron [closed]
I have a raspberry pi which stays on for extended period of time. To avoid it from crashing, I have a cron job that periodically checks for top memory consuming apps and then restarts them as needed. ...
3
votes
1
answer
1k
views
Pygame.mixer does not play sound when started in cron
I have written a small python script that plays a track after the press of a button (and ignores further button presses until the track has completed). The script works perfectly fine when started ...
0
votes
1
answer
3k
views
Cron python job not running
I tried to automate the launch of a python script.
After having tested it works in thonny, I moved to Cron and I got quite lost.
I started from calling 12 21 * * * /usr/bin/python3 /home/pi/main.py
to ...
0
votes
2
answers
4k
views
How to schedule the power on / power off of a Raspberry
What are the solutions to locally schedule the power on / power off of a Raspberry (power on at 8 am and power off at 8 pm) ? I was asked to do so by the person in charge of my project. I told him it ...
0
votes
1
answer
698
views
Crontab does not work
I am trying to run either at boot or at intervals of 5 min (everytime basically) a command that enables me to use my remote control.
Thus sudo crontab -e -u root, I add in crontab the following line:
*...
0
votes
1
answer
68
views
Cronjob does not work anymore after copying it
I recently reinstalled my Raspberry Pi after I changed the microSD-Card. I copied all my cron jobs manually (in /var/spool/cron/crontabs/) and after I imported them with root on my new installation, ...
1
vote
1
answer
1k
views
arecord no such file or directory error when running via cron
So I can run:
arecord -d 9 -f S16_LE -c 1 -r44100 -t wav /home/pi/signal_9s.wav
from terminal and it works as expected. It records for 9 seconds and saves to the signal_9s.wav file. However if I set ...
0
votes
1
answer
384
views
Cron job not working on python script for power monitoring - HS110
I have cobbled together a script which runs as a standalone python file. It successfully connects to the HS110 smart plug from Kasa/TPLINK and posts the power in Watts to my webserver. This all works.
...
-1
votes
2
answers
433
views
Problem with crontab -e. Does not saving photos using autorun
Does not save photos using auto-launch in crontab. I use Python 3 or raspistill, they work well for photos when a monitor is connected.
#!/usr/bin/python3
# BEFORE USING THIS SCRIPT.
# ...
-2
votes
1
answer
918
views
Crontab Permission Denied running simple Python Script
I've been trying to get this to work for DAYS. Its doing my head in because everything i search suggests this work.
The process is Cron executes bash which executes python
I open and edit the cron ...
0
votes
2
answers
534
views
Using shell with cron
I have an app controlling a piece of connected hardware that displays a few lines of info and requires user input (on stdio). The app runs fine from a shell.
I set up the RPi to auto-login with CLI ...
0
votes
2
answers
540
views
Crontab runs but nothing happens [closed]
I want to run a script daily with Crontab, then, I added that line:
30 1 * * * /usr/bin/python3 /home/pi/.../uploadFiles.py >/dev/null 2>&1
If I copy and past the line /usr/bin/python3 /...
0
votes
3
answers
2k
views
How to schedule turning off and on of a pi4 using cron?
How to schedule turn off and on of a pi4 using cron ?
Hello, to save power I wanted to schedule precisely when my RPI has to be turned on and off.
I think Cron was a good solution so I try to edit ...
0
votes
1
answer
2k
views
Raspberry pi crontab won't restart service
I have a raspberry pi that is running an outdoor camera. Occasionally, the camera 'locks' and I have to restart the service as root and it starts working again. Since the camera is outside it's in a ...
1
vote
1
answer
238
views
exim4/mail Usage Question
I have a bash script (daily.sh) that runs daily as a cron job for user pi. Recently, I received an email notification on my RPi that an error had occurred in daily.sh. It turned out that this email ...
0
votes
0
answers
257
views
wget command in sudo crontab
On my RPi Buster I am using sudo crontab -e to get image from http page:
*/1 * * * * /usr/bin/wget -b http://lutov.radionet.sk/phpmyadmin/inovec.jpeg -O /var/www/html/wp-content/uploads/inovec.jpeg -o ...