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.

Filter by
Sorted by
Tagged with
1 vote
2 answers
62 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 ...
mu88's user avatar
  • 113
0 votes
0 answers
80 views

Raspberry Pi 3B+ freezes on cron reboot

I set up a cronjob on my Raspberry Pi 3B+ (1GB RAM) to reboot every morning, which worked fine for over a year. For three days, however, the RPi has been crashing immediately after reboot. By “...
Pixelcode's user avatar
  • 101
3 votes
0 answers
139 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 ...
Serge Charbonneau's user avatar
1 vote
1 answer
149 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. ...
PangolinPaws's user avatar
1 vote
2 answers
192 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 ...
roconnor's user avatar
1 vote
0 answers
170 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 ...
Gouz's user avatar
  • 115
0 votes
3 answers
467 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 ...
Achal Kasturia's user avatar
0 votes
0 answers
63 views

crontab fails in fresh installation

looking for quick answer. Fresh install of RPi, installed a couple of libraries to support my code. ran code successfully. Tried to create a bootstrap using crontab to automatically load and run my ...
Roger Mckee's user avatar
0 votes
0 answers
221 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 ...
JeremiahDuane's user avatar
0 votes
1 answer
241 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/...
Matt Welander's user avatar
-2 votes
1 answer
146 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 ...
Bastian's user avatar
2 votes
1 answer
76 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 ...
Matt Welander's user avatar
1 vote
2 answers
204 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=...
APEX's user avatar
  • 11
2 votes
0 answers
49 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 ...
ho88it's user avatar
  • 31
2 votes
3 answers
184 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 ...
Fruity Fritz's user avatar
0 votes
1 answer
1k 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 ...
Pa Dalton's user avatar
1 vote
2 answers
341 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 ...
S. ten Brinke's user avatar
0 votes
2 answers
142 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 ...
Vilmer Folcke's user avatar
0 votes
1 answer
139 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 ...
renaldyks's user avatar
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 ...
pythonlearner123's user avatar
2 votes
2 answers
368 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 ...
Ole Albers's user avatar
0 votes
0 answers
242 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 ...
Somecode's user avatar
1 vote
1 answer
107 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 ...
nikUoM's user avatar
  • 113
0 votes
3 answers
1k 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 ...
DaSnipeKid's user avatar
0 votes
1 answer
79 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 ...
BobtheMagicMoose's user avatar
0 votes
0 answers
72 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 ...
kstthomsen's user avatar
-1 votes
3 answers
821 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 @...
Zack Tim's user avatar
0 votes
2 answers
45 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: ...
Luis Lange's user avatar
0 votes
1 answer
851 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. ...
Akt's user avatar
  • 3
3 votes
1 answer
869 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 ...
robertmusil's user avatar
0 votes
1 answer
2k 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 ...
mant0's user avatar
  • 1
0 votes
2 answers
3k 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 ...
Axel Carré's user avatar
0 votes
1 answer
593 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: *...
Alessio_110's user avatar
0 votes
1 answer
57 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, ...
AlphaInc.'s user avatar
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 ...
Chase Roberts's user avatar
0 votes
1 answer
371 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. ...
NorthoftheWall's user avatar
-1 votes
2 answers
371 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. # ...
Albertas T.'s user avatar
-2 votes
1 answer
758 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 ...
Felixr2's user avatar
0 votes
2 answers
315 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 ...
user120300's user avatar
0 votes
2 answers
359 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 /...
Dark Patate's user avatar
0 votes
3 answers
1k 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 ...
Antoine Riguillard's user avatar
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 ...
user1070061's user avatar
1 vote
1 answer
171 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 ...
Seamus's user avatar
  • 21.1k
0 votes
0 answers
236 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 ...
miso k's user avatar
  • 9
0 votes
2 answers
388 views

Execute A Jupyter notebook file using runipy -o myfile.ipynb command upon Raspberry PI 4(Raspbian OS) boot-up

My research regarding this issue: All methods available on the internet are about running .py files on Raspberry Pi boot. NO ACTUAL HELP ABOUT RUNNING JUPYTER NOTEBOOK FILES .ipynb ON RASPBERRY BOOT ...
Afaq Khan's user avatar
1 vote
1 answer
127 views

gallery-dl script doesn't work with crontab or rc.local but works manualy

I wrote a simple script that cycles through a file and grabs some links from a file to run through a program called gallery-dl. This script works fine if i run it manually but just wont work with ...
WaffleGod54's user avatar
0 votes
1 answer
39 views

code does not run off @reboot tag

Not sure where the issue is but my code doesnt run correcrtly when its in a cron. This is in my cron.d: SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin @reboot pi /home/...
chowpay's user avatar
  • 101
2 votes
2 answers
2k views

Unable to edit cronjob, /tmp is read-only

I am trying to make my raspberry pi automatically restart every week. But I am unable to create the cronjob as I get a error message that the temporary crontab file was unable to be created. /home/pi $...
Gabriel Fair's user avatar
6 votes
5 answers
3k views

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

I have a Raspberry Pi that is acting as a sensor which I am sending out to various customers. The sensor is recording approximately 1 GB every 2-3 days, so I would like to have a way to remove old ...
Cameron Greenwalt's user avatar
0 votes
1 answer
199 views

CRON service shebang

For CRON schedule that I am trying to run a .py file... Does the shebang at the top of a .py file need to state the version of python? #!/usr/bin/env python If I need Python 3, should this be: #!/usr/...
bbartling's user avatar
  • 237

1
2 3 4 5 6