As of May 31, 2023, we have updated our Code of Conduct.

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
1 answer
487 views

Running ruby script with eventmanager on startup

I hope somebody can help me with the following. I need my Raspberry to run a ruby script on startup which uses ruby's eventmachine package. I've installed rvm, the correct ruby version (2.1.0-dev), ...
0 votes
1 answer
251 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 ...
1 vote
2 answers
151 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=...
5 votes
1 answer
670 views

crontab entry with parameters?

My goal was to make my Pi create its own WiFi on start so that I can connect to it wirelessly. I have succeeded by creating a crontab entry (using sudo crontab -e): @reboot /path/to/create_ap.sh &...
2 votes
1 answer
21k views

Where is the cronfile located? [closed]

I am writing a python program to go on the raspberry pi. I am currently making an installation script that will as part of its installation process, add a line on cron so that it will automatically ...
3 votes
0 answers
81 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
53 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
112 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 votes
1 answer
865 views

How to start a VNC session correctly on Raspbian?

I start my VNC server via a @reboot vncserver & entry in my user's crontab. But this seems to cause some problems since the cron environment is restricted. For examples see: Get Bash instead of /...
0 votes
4 answers
748 views

Crontab or cron.d to run a wav file. What am I doing wrong?

I have been at this for a month now. New to programming. Trying to run a schedule for wav files to execute. Using Raspberry Pi 3 and Raspbian Stretch. My cron.d file called 'BellCron' is as ...
1 vote
0 answers
111 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
1 answer
50 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, ...
0 votes
1 answer
671 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 ...
0 votes
3 answers
250 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 ...
-2 votes
1 answer
77 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 ...
0 votes
0 answers
51 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 ...
0 votes
0 answers
128 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
1 answer
148 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
69 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 ...
0 votes
0 answers
19 views

Shell script started with crontab not completly executed at startup after changes

When I start my RPi Zero W, I run a shell script via Crontab. This shell script creates some environment variables and than runs a python program. This has been working for several months now, without ...
3 votes
1 answer
744 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
0 answers
23 views

Give ssh deamon higher priority than CPU-hogging process

I've got a web scraper running every 30 minutes via a cronjob. The web scraper is working well, but I'm now struggling to ssh in (I don't have any monitor hooked up to it so ssh is the only way I can ...
2 votes
0 answers
47 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 ...
0 votes
1 answer
116 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
3 answers
1k views

Run autossh on reboot through crontab

I'm trying to run two command at reboot on my raspberry pi. Here is what I tried : @reboot sudo su - pi -c "screen -dm -S myscript_cron python ~/myfolder/myscript.py" @reboot sudo su - pi -c "screen ...
2 votes
3 answers
158 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
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 ...
4 votes
1 answer
925 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 ...
0 votes
1 answer
3k 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 ...
1 vote
2 answers
226 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 ...
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 ...
0 votes
2 answers
122 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 ...
5 votes
3 answers
1k 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 ...
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 ...
0 votes
0 answers
197 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
93 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 ...
1 vote
3 answers
1k views

script runs at terminal - but not in cron

I'm logged in as user pi via SSH and have a wifi checking script wifi_test_1.sh in the following directry: /usr/src/scripts/wifi_test_1.sh When i enter the command /usr/src/scripts/wifi_test_1.sh ...
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 ...
35 votes
2 answers
147k views

Open chromium full screen on start up

I would like to set up a couple of Raspberry Pis to open automatically chromium or any other browser available to at start-up, and in full screen mode. I was wondering if any of you can help me. ...
3 votes
4 answers
7k views

How do I create a cron job to execute PHP?

I've been trying to execute a PHP file via a cron job, but I can't seem to get it to work. I've set the permissions of the relevant file to 777. Here is the line I've currently got in the crontab file....
0 votes
1 answer
68 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
68 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
589 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
44 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
666 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. ...
0 votes
3 answers
4k 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/...
-2 votes
1 answer
692 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 ...
4 votes
3 answers
5k views

Crontab on Rpi not running Python script

I have a simple problem that I cannot seem to find an answer to even though I have done some research. I am trying to run a python script via crontab (I have never worked with crontab before this haha)...
22 votes
5 answers
65k views

How do I reboot at a specific time?

Is it possible to re-boot my Raspberry Pi at midnight each night? I know in Linux, you'd use crontab, but I can't seem to find /etc/crontab.
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 ...

1
2 3 4 5 6