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
3answers
37 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
47 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 ...
0
votes
1answer
301 views

How can I stop this script (date an time with I2C LCD)

I found this script to show date an time on this site: http://www.circuitbasics.com/raspberry-pi-i2c-lcd-set-up-and-programming/ Once is running how can be it stoped? I like the idea of showing the ...
0
votes
1answer
17 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
1answer
339 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
0answers
40 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
1answer
423 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), ...
3
votes
1answer
474 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 &...
1
vote
1answer
8k views

Unable to run `@reboot` crontab at reboot

I am trying to run two Python programs at reboot with my Raspberry Pi 3. The problem is that crontab doesn't run at reboot. I tried to run the programs with crontab every 5 minutes and everything ...
0
votes
2answers
42 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
1answer
751 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
2answers
791 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
3answers
963 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
1answer
76 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 ...
2
votes
1answer
487 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
0answers
20 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
26 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
25 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/...
0
votes
1answer
13k views

cron not running @reboot command

@reboot commands are not being run from cron. I verified this with grep cron /var/log/syslog which showed Jul 25 16:17:01 picam2 /USR/SBIN/CRON[4487]: (root) CMD ( cd / && run-parts --...
2
votes
2answers
74 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
17 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 ...
1
vote
1answer
71 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 ...
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 ...
0
votes
1answer
33 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/...
0
votes
1answer
76 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 ...
2
votes
2answers
67 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
2answers
79 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
19 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
2answers
2k 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
6answers
10k views

How to move mouse pointer to a specific location on the screen AT BOOT?

I recently downloaded the latest and greatest Raspbian OS for my PI, enabled hide function on taskbar and have installed xdotool. For what I want to use PI for, I need to have the taskbar hidden at ...
1
vote
1answer
35 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
2answers
1k 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 *        ...
1
vote
0answers
79 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
103 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 ...
3
votes
3answers
2k views

Get Bash instead of /bin/sh in a VNC session started by cron

When I open a terminal (e.g. lxsession or xterm) in LXDE which is running in a VNC session the shell is $ echo $SHELL /bin/sh However, I want my default shell which is /bin/bash to use my .bashrc ...
2
votes
1answer
132 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 ...
1
vote
2answers
80 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 ...
0
votes
2answers
78 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
50 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
166 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
91 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
102 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
2answers
239 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
163 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 ...
3
votes
1answer
340 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
1k 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 ...
2
votes
2answers
951 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 ...
0
votes
0answers
71 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
2 3 4 5