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.
219
questions
0
votes
1answer
16 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.
...
0
votes
2answers
28 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.
# ...
0
votes
1answer
35 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
2answers
38 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 ...
1
vote
2answers
33 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
3answers
76 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
1answer
67 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
1answer
26 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
0answers
48 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 ...
0
votes
2answers
58 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 ...
0
votes
0answers
22 views
Raspberry Pi4: Background changes from script does not show when changed
I am running on a Raspberry Pi4 with a 64 bit Ubuntu 20.10. I am trying to make a script which can change the desktop background from a script called each minute from cron. This I have made before on ...
1
vote
1answer
27 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 ...
0
votes
1answer
26 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/...
2
votes
2answers
117 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 $...
0
votes
0answers
19 views
Help with Pi4, xdotool not registering input unless chrome already open
Hoping someone may be able to help - have a freshly installed Pi4, Raspberry OS / Buster.
Device was headlessly installed (has never had output connected, and I think this may cause issues later), and ...
6
votes
5answers
2k 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 ...
0
votes
1answer
39 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/...
2
votes
2answers
76 views
Can't run python script on startup. Raspberry Pi 4
I am trying to run a python script when my Raspberry pi 4 boots. THis python script works when I run it directly, with no errors. I have edited the crontab file to do this as can be seen below:
# ...
0
votes
1answer
85 views
CRON schedule to run a .py file [closed]
Im trying to follow this blog about setting up a CRON service to run a .py file every 15 mintes
In the blog it states to place your .py file in the /home directory and then make sure you can execute ...
0
votes
2answers
97 views
CRON vs While loop [closed]
I have a Twitter bot that checks for new tweets every 60 seconds... Would setting up CRON to run the script every minute be better than putting the script in a (24/7) while true loop with sleep(60), ...
2
votes
4answers
2k views
Why is cron needed for Raspbian?
I was looking for some sort of process that is lagging my device. While searching I found that cron is running. If I understand this correctly then cron is needed to run serials of command at a ...
0
votes
0answers
23 views
imapclient is working fine when I run it by hand but not when I run it using cron
Currently, I have a python program where my pi will check if a certain email address has a certain email and then run another piece of code. When I run the script normally there is no issue with it, ...
1
vote
1answer
42 views
Python script refuses to start automatically
I have a python script (taken from the forums here) that reboots my RPI when a button is pressed.
It works great, no issues, except that it refuses to start automatically (either on boot, login, ...
2
votes
0answers
93 views
Raspberry Pi stops running cron job after a few hours
My raspberry pi 4 is set to run a python script every hour that turns on some philips hue lights and takes a picture with the camera module. It worked perfectly for 26 days, then it stopped running. ...
1
vote
1answer
119 views
Parts of code not running when autostarting script in crontab
I am getting some really strange behavior when trying to run a python script at start up using an sh script in crontab.
Here is the python script (it controls wifi lights in my house):
#IMPORTS
from ...
2
votes
1answer
149 views
Raspberry Pi in forever reboot loop crontab
I was trying to setup my raspberry pi in crontab to reboot every time at midnight, it didn't work, So I set it to run the command every minute, didn't work, so I put sudo in front of reboot, now I ...
0
votes
2answers
106 views
Global variable environment not read crontab - webmin
In my program, I retrieve a value from a global variable if I run a program in the python console everything works, I defined the global variable as follows:
export GOOGLE_APPLICATION_CREDENTIALS = /...
1
vote
0answers
54 views
Autorun Python script with Pyserial on Startup with Crontab
So I am looking to do something that I thought was simple....
I just have a script that imports and uses pyserial and I want it to run automatically when the pi is booted up. I have an LED rigged up ...
3
votes
2answers
194 views
Crontab not executing php scripts
My problem is that crontab is not executing my php script /home/pi/CronTabFiles/saveThermometer.php
I tried a lot of things, I don't remember everyone of them but I'll list what i consider mains one. ...
2
votes
1answer
544 views
How to execute a Python 3 + OpenCV 4 script @reboot on Raspbian Lite (headless)?
The Python script works perfectly fine when ran from the command line while signed in as the "pi" user, with this command:
python3 /home/pi/www/main.py &
But from the crontab, it just doesn't ...
1
vote
1answer
98 views
Crontab with WiringPi
I want to change pin state at certain time with Crontab.
I tried to use this command: 7 0 * * * /usr/bin/gpio -g write 0 0
but it returns me this error: bash: 7: command not found
I also tried: 7 0 * ...
1
vote
1answer
110 views
python script not launching when put into crontab
I have two python scripts, flickSwitch.py & measureTemp.py, the first calls the second when a button is pressed. All works fine when run directly from /home/pi.
I put the first script into ...
0
votes
1answer
84 views
How to clear the screen and auto-mount device on startup?
I have a Raspberry Pi connected to my TV, which I use to read videos stored on an external hard drive.
I have 2 commands that I run everytime the Raspberry Pi reboots:
This one, to clear the prompt ...
0
votes
2answers
966 views
Display a video at boot
we want to show a video in the entrance hall with the activities of our company.
Now in crontab withcrontab -e i have this line to open the movie file that we want to show.
@reboot vlc ~/Desktop/...
0
votes
2answers
285 views
Setting up a shell script to run at boot with sudo permission
I had issue with BLE Connection which would drop after certain time which I solved using solution from this post:
https://unix.stackexchange.com/questions/288978/how-to-configure-a-connection-...
0
votes
0answers
193 views
AutoStart Slideshow can't find pictures
I am trying to get Raspberry Pi to startup running a slideshow of various JPEGs on a USB stick
I can get the shell (below) to run no problem from terminal
I set crontab to execute the shell (shown ...
0
votes
0answers
74 views
How do I cron schedule a playlist shortcut on my desktop
How do I trigger a shortcut "My_Favourites.xspf" that lives on my desktop.
I would like to start playing this playlist of music in the morning to wake me up.
Just to explain better: When I double ...
1
vote
1answer
2k views
HOW TO: Schedule in crontab a Python script with Selenium driver to show chromium browser on DISPLAY :0.0
I would like run a specific moment a python script to show with selenium the chromium browser on DISPLAY :0.0 .
00 11 * * * pi export DISPLAY=:0.0 && "/usr/bin/python2.7 /home/pi/Desktop/...
2
votes
3answers
2k views
chromium-browser --headless 'errors' stopping script in Crontab
I have a script that works out the version number of todays Guardian crossword and makes the url address that I want to print from (I can wget a pdf and print that, but I (well my wife) prefers the ...
6
votes
1answer
4k views
What's different about a crontab reboot?
I have a python script to log data from a USB weather station and present it via a flask front end. The USB on the pi (Pi2 model B) is flaky and occasionally hangs after 24-48 hours. The flask app ...
1
vote
1answer
55 views
Cronjob does nothing?
Does anyone know about crontabs here?
I've programmed a fine dust station with values āāacquisition, LCD display and so on. The particulate matter station is to be exhibited at the university, but ...
0
votes
0answers
341 views
Start python server and Vue front end at boot
I'm trying to have my raspberry pi start a python server with connected Vue.js frontend at startup.
Right now i'm using crontab with the following configuration:
@reboot sh /home/pi/Desktop/server-...
2
votes
1answer
125 views
Why no result from os.popen() when script is run from crontab?
When I run this Python3 script from the command line or from Thonny I get correct results. When I run it through crontab the variables ipaddress an ssid stay empty.
Can anyone tell me why? Any ...
3
votes
1answer
363 views
Run turn off/on HDMI on specific time
I want to do the following:
Use my raspberry pi as a smart display, kind off like what the Chromecast does when it's not streaming anything. I also want it to turn on and off at certain times, like ...
1
vote
1answer
72 views
Play a defined set of MP3's on defined days
am new to Python and have been struggling to create a workable script for a friends project - am hoping someone can point me in the right direction!
The script is to control playback of mp3 files ...
1
vote
1answer
490 views
What is the environment for cron?
When issues arise using cronĀ to schedule events, a frequently-heard explanation is that cronĀ runs with a different set of environmentĀ variables than a "normal" user (e.g. pi). That's all well and good,...
1
vote
2answers
2k views
@reboot with crontab, what am I doing wrong?
I have an .sh file located at '/home/pi/startup.sh' which I want to have running soon after bootup.
I have my crontab with the following information.
# m h dom mon dow userĀ Ā Ā Ā Ā Ā Ā Ā command
17 *Ā Ā Ā Ā Ā Ā Ā Ā ...
0
votes
2answers
575 views
Tinkering with environment variables
i want to run my pi headless, and only wire up some switches via gpio to operate it. i want it to monitor 3 switches, and tell if theyre high or low, and react accordingly. it should be launched every ...
1
vote
2answers
2k views
cron not executing python3
I am running Raspbian Stretch and have a python 3 script that executes correctly when I am in the relevant directory and input it in the command line as:
sudo python3 Example.py
The shebang #! line ...
1
vote
1answer
198 views
Call chromium within a Python script in crontab
I'm doing a digital signage project for a marketing agency that I work for. I have a Python Script that when called manually in Shell does everything, log and then opens Chromium.
But when It starts ...