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
0
votes
1answer
26 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
53 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
67 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
36 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
15 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
30 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, ...
1
vote
0answers
48 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
65 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
52 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
42 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
36 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
79 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. ...
1
vote
1answer
304 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
71 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
78 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
45 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
304 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
161 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
97 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
62 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
931 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
3k 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
51 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
213 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
81 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
254 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
63 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
367 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
884 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
408 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
1k 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
163 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 ...
0
votes
3answers
673 views

Crontab suddenly doesn't start jobs

I'm suddenly having crontab issues, I didn't do anything other than change the script names and then change them in crontab as well so they all natch, the scripts work if I start them manually, so i'm ...
0
votes
2answers
254 views

Restart Pi after ping failure?

I have been creating a prototype using Pi Zeros, they work great at my house but are failing often at customer's site (other side of country). I do not know if the Pi kernel is crashing or if it's ...
2
votes
1answer
2k views

Automatic shutdown of Pi based on timer

I'm looking to have my pi shutdown automatically based on a time interval (rather than the time of day). This is for an art installation and the reason I am turning off the pi is because it will ...
-1
votes
1answer
325 views

Unable to run python script on boot

I wrote a script for object detection and if I establish ssh connection to Raspberry Pi and run it from console, everything works fine. As I would like to start the script automatically on boot, I ...
0
votes
0answers
33 views

Crontab jobs wont save on RPI with Xfce4 (no goodies) installed

I have a raspberry pi with the minimal image of Raspbian running the goodie-less version of XFCE4. After install my neccessary packages I have created a user named screenagent who is logged in ...
1
vote
2answers
69 views

Cronjobs sometimes fail to run fully when launching many Python scripts [closed]

I have about 30 Python scripts that I have scheduled to run via cron. Usually, I can run cronjobs on a Raspberry Pi just fine but I usually also only do a handful only. These scripts are essentially ...
1
vote
0answers
120 views

Script runs in terminal, but not in cron?

I have a script that runs OK in a terminal, but it doesn't run in cron. I've spent the last 5 hours on google and I'm not getting anywhere with it. The main code is as follows: import os import ...
0
votes
1answer
105 views

Command from terminal and script on startup

Is it possible to run a python script as well as a command from terminal on startup? I have successfully executed the python script as mentioned in the link below. https://www.instructables.com/id/...
2
votes
2answers
3k views

How to stop python script that was started with crontab reboot

I have a python script that continuously saves data to a CSV file and is started as soon as the Pi starts up using crontab reboot. Does anyone know how I stop the script from within the Raspberry Pi ...
1
vote
1answer
49 views

Cronjob is missing the GET parameter in Raspberry Pi

I am using a headless raspbian OS on Raspverry Pi 3B+. I have placed the following code at the home directory of the user pi #!/usr/bin/env python import socket import httplib s = socket.socket(...
0
votes
1answer
531 views

Reinstall Raspbian without wiping SD card

I recently upgraded my pi3 using apt. After a number of packages were upgraded, cron stopped working. Instead of executing its jobs, cron now drops a message in /var/log/daemon.log: Oct 29 19:40:01 ...
0
votes
1answer
814 views

Schedule a cron job to send temperature via e-mail

Greeting's, I am running an apache2 server on my raspberry pi. I wanted to keep a tab on it's temperature while I'm travelling. I know that following two commands will give me the GPU and CPU ...
4
votes
3answers
3k views

Execute a script at sunrise/sunset

Good afternoon, I'm trying to edit by soft, as a text file, the file that contains the crontab data. This is because I need to execute a series of functions daily, they are related to the sunrise and ...
2
votes
2answers
783 views

Automatic startup browser

I have a script that starts iceweasel with a certain webpage if iceweasel is not already running. It should start iceweasel on the local screen, in other words the screen plugged directly into the ...
1
vote
2answers
132 views

crontab schedule .py file

I am attempting to run a scheduled .py file every 5 minutes with crontab but I don't think it's working. I'm following this post with the instructions: Can't run python script from cron I opened ...
2
votes
1answer
43 views

Cronjob deleted but cron still sends email

I have in /etc/crontab a job defined like this: 0,10,20,30,40,50 * * * * root /usr/lib/cgi-bin/awstats.pl -config=example.com -update I deleted this job but cron sends me still emails every ten ...

1
2 3 4 5