Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
2answers
30 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
44 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 ...
0
votes
2answers
106 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 ...
0
votes
3answers
68 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
44 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 ...
1
vote
1answer
41 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
46 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
15 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
39 views

Cronjobs sometimes fail to run fully when launching many Python scripts

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
73 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
36 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
365 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
32 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
157 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
142 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 ...
2
votes
2answers
418 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 ...
0
votes
0answers
21 views

automated way to restart a bitcoin node occasionally

Is there a way to reboot a bitcoin node occasionally (maybe once a day) in an automated way? Basically some way to Gracefully shut down bitcoind (i.e. wait for it to shut down completely). Reboot ...
0
votes
1answer
181 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
83 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
34 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
vote
1answer
216 views

Python script not running when added to crontab

I have an on_reboot.sh file that contains the following: #!/bin/bash source /home/pi/.profile workon cv cd /home/pi/reboot python pi_test.py After that I made the file executable using $ chmod +x ...
0
votes
1answer
300 views

How to run a script which uses I/O's on startup?

I have a python script which makes use of the standard RPi I/O's where I am detecting multiple inputs and storing values to a database. The script runs without exiting until the Pi is powered off. ...
1
vote
1answer
37 views

YA Cron Question

I have a python script called mediacircus.py that works when run manually (using Idle) in /home/pi. I have a Cron schedule to run it every minute that looks like this: * * * * * /usr/bin/python /home/...
1
vote
2answers
83 views

Start Python CLI app on startup

I have a Raspberry Pi 3b+ that is booting to the pi user terminal, no GUI. I need to have a small CLI app run after the pi has finished booting. So far I have tried editing /etc/rc.local, and using ...
0
votes
3answers
68 views

Crontab Unresponsive

I am trying to get my Raspberry Pi B+ to run a shell script everyday at the same time, and I am trying to use Crontab to do it. I run sudo crontab -e to access my Crontab programs, and added the entry ...
1
vote
2answers
45 views

Automatically launching a script after full boot [duplicate]

New here and know that launching programs is a well discussed topic, but I've got a slightly different need that I think is complicating the solution. I've got a straight forward python script that ...
0
votes
1answer
59 views

Cron Job turns off the matrix MAX7219 after finishing the script

I have a script in python3 which executes and shows information in an 8x8 MAX7219 matrix and works perfectly. When I run the script directly from the .py file, the matrix does not turn off (and that's ...
0
votes
0answers
123 views

Xdotool not working in Crontab

My main goal was to make a basic shell script that would close down my chromium tabs before shutting down. This was my script: xdotool key ctrl+w & sleep 15; sudo shutdown -h now After changing ...
0
votes
1answer
35 views

How can I disable Cron jobs from Windows?

My friend thought it would be funny to make a Cron job on my pi that made it shutdown every minute, so now it boots and immediately shuts down. Can I delete the file with the Cron job from a windows ...
1
vote
2answers
49 views

Skip first job run at reboot with Cron

I'm trying to run a Bash script with Cron every 5 minutes to check if my Raspberry Pi have changed its IP address or not and update me, this is the script i'm using. #!/bin/bash #check and send ip ...
1
vote
2answers
211 views

What's wrong with this little python script?

I followed this tutorial to log my CPU temperature into a .csv-file and try to run the .py script it at bootup with cron. The script: from gpiozero import CPUTemperature from time import sleep, ...
0
votes
1answer
215 views

How to run a C program at boot time [duplicate]

I have a project and it is running a c program on the PI. The program is meant to start running at startup. So far I have tried to do this with rclocal, but this is depricated. Afterwards I tried ...
0
votes
1answer
1k views

Cron vs. Python ‘schedule’ for scheduling tasks with Flask

I’m looking to implement a script that calls a web API at regular intervals (e.g. every hour). I’m using Flask as my server. Should I use the Cron framework, or is it better to use Python’s schedule ...
4
votes
3answers
172 views

Python script run from crontab does not recognize USB drive mounted later

I am having a bit of a problem here, I really hope some of you can point me in the right direction: I made a python3 program running a loop and checking if the file /DATALOGGER/DATALOGUSB/SETUP.py ...
0
votes
0answers
49 views

Cron doesnt run specific .py file

I wrote a code in Python to change Bluetooth Low Energy information. If I write for example python beacon.py 12 12 major of BLE advertised data will be 12 and minor will be 12. When I run it using ...
5
votes
3answers
506 views

Is it necessary to release Raspberry Pi Camera before rebooting? If so how do I do it?

I have a python3 script that uses OpenCV and a Raspberry Pi cam. It runs almost 24/7. Using crontab the pi will reboot every night at midnight and the script will begin running again. This is mostly ...
0
votes
2answers
495 views

Raspbian 04-18 Cronjob won't run with @reboot

I'm trying to find any solution to this problem but for some reason I can't manage to make this work properly. The only thing I need is to run a .sh file located in the /home/pi folder. I did it like ...
0
votes
1answer
47 views

How to wait for X-Server to init before crontab

Kindly refer to my problem at: crontab @reboot starting an UI Application I tried to use sleep in my script. It won't work. May I know how can I wait for X to start before running my crontab? Many ...
0
votes
0answers
88 views

crontab @reboot starting an UI Application

I was able to do this until I downloaded the latest raspberry pi image. It is a DotNET WinForm application. Started in crontab using @reboot /home/pi/auto.sh #!/bin/bash cd /home/pi/test export ...
0
votes
1answer
485 views

Autostart python script and see its output on the terminal

Is there any way that i can auto run a python script at boot and see its output on the terminal other than editing the .bashrc file ? I tried using crontab job and putting myscript in /etc/init.d/ ...
0
votes
1answer
210 views

Script Running in Background GPIO.cleanup() on shutdown

I have been searching for answer to this. I have python script that runs on start up via cron, and lights up some different LEDs based on button pushing using the GPIO pins and runs in the background ...
0
votes
1answer
571 views

Cron jobs not running when specific time specified

I have a crontab that looks like this: * * * * * /bin/date >> /tmp/every-minute.log 0 8 * * * /bin/date >> /tmp/eight-am.log The first line works just fine. The second does not seem to fire at ...
0
votes
0answers
142 views

Crontab doesn't work after reboot by cable plugging out

I have a crontab task for python script (IOT hub by microsoft) launch. It launches properly after "sudo reboot" and by manual script launch, but doesn't launch properly after reboot by cable plugging ...
0
votes
1answer
338 views

`crontab` fails to run Python3 code at boot (no GUI involved)

After searching for some time- I can;t find the reason that my python3 code won't execute during boot. I'm using Rpi Zero, using StrechLite OS. Code run OK when is executed from command line. crontab ...
3
votes
1answer
664 views

logging data when using crontab

Edits: added comments to code. I am running a small .py script on my Raspberry Pi with a DHT11 sensor and 3 LEDs. I am starting the program on boot with crontab, and everything is running fine apart ...
1
vote
2answers
94 views

Cron and atd jobs cant see manually mounted file systems (mounted while on ssh) [closed]

I recently upgraded to debian [/raspbian] buster. Ever since then, cron jobs creating directories using mkdir -p <directory name> will create the directory on the root file system / device ...
1
vote
1answer
466 views

Launch tightvncserver at reboot using cron

Starting tightvncserver manually from a terminal works fine. To start it @reboot I am using crontab -e with the following command: @reboot sleep 20 && /usr/bin/tightvncserver The path is ...
1
vote
1answer
457 views

Stop an automated task with cron?

I am trying to run a python script overnight on a Raspberry Pi, starting at 1900 and finishing at 0700, which scans the environment around the machine for MAC addresses of nearby devices for security ...
0
votes
1answer
63 views

Crontab not wrote into schedule after reboot and always restore to a specific time

I have a tiny computer, raspberry. It's a good computer. Recently, I got a problem when it run crontab and the problem is as this title. Otherwise, the system is always to restore. After editing ...
1
vote
1answer
58 views

Failing to record audio using cron

I'm not having any success getting the below line to run in Cron. I've added / before % due to it being a special character. It works without the / when run directly from Terminal. Eventually I'd ...