Questions tagged [cron]

Cron is used to execute scheduled commands. It acts as a task scheduler on Linux and UNIX systems which will execute commands at specified times set by the user. Cron has a great deal of customization and is often used on server environments where common tasks are run on a regular basis.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
32 views

Restart network adaptor if system isn't on WiFi

So, I'm using Kubuntu 23.10 and I have an issue where since I moved to a new house I can't install Ethernet ports on the walls. Since I'm using an old PC to run a webserver and have to use WiFi (which ...
Eduardo Perez's user avatar
0 votes
0 answers
26 views

Running shell script with crontab but output is not displayed in the terminal [duplicate]

An enthusiastic Linux learner asks this: The abarco user is trying to run a simple shell script with crontab. Here the script: myjob.sh: #!/bin/bash echo Hello i am running $0 at $(date) The script ...
luis arturo barco gonzalez's user avatar
0 votes
1 answer
62 views

how to write cronjob

I tried to setup cronjob for python script erpnext_sync.py which is in located at /home/user_name/frappe-bench/biometric-attendance-sync-tool $ crontab -l * * * * * /usr/bin/python3 -c 'from ...
fit's user avatar
  • 1
0 votes
0 answers
30 views

Why is the plocate database not updating?

In one of my computers (C1), the plocate database is not updating, see command #2 below, run today 03/21, showing a database last updated on 03/14 (it was manually updated). The configuration is ...
sancho.s ReinstateMonicaCellio's user avatar
0 votes
0 answers
32 views

Failed to logout using cron

I am trying to log off using editing crontab -e with the command * * * * * gnome-session-quit However, after one minute it is not asking or going for logout. Can anyone help me why is this the case? ...
Muhammad Zohaib Zafar's user avatar
1 vote
1 answer
85 views

Scheduled a computer to reboot everyday at 7AM, not sure if I did it correctly

Running Ubuntu 20.04, I have computers that I want to reboot everyday at 7AM. I followed these instructions, and I thought it was working, but now when I use the uptime command, it will often report ...
Jackjackson's user avatar
0 votes
1 answer
46 views

Start @reboot crontab script in a new tmux/byobu session and be able to connect to it

I have a crontab entry that starts a backup job script after reboot: @reboot (sleep 120 && bash /srv/recvuser/cron_autostart.sh) 2>&1 | /usr/bin/mail -s "SuperServer ZFS Backup&...
Alex's user avatar
  • 141
2 votes
1 answer
68 views

I need to automatically start a non GUI application through a terminal line because I don't have a GUI

I have a proxmox ubuntu container running ubuntu 23.10 and becuase it is a container it doesn't allow me to use a GUI. I need to run a server application as soon as the container boots up incase it ...
jelacksmith626's user avatar
3 votes
2 answers
277 views

unable to mount external drive from cron (using udisksctl)

GOAL I'd like to mount an external drive using cron for automatic backups, preferably with udisksctl. PROBLEM udisksctl mount -b /dev/sdXY works fine from the command line or shell script, but when I ...
petermao's user avatar
1 vote
0 answers
58 views

Error when running docker desktop from cronjob

I have a script that checks every minute if docker desktop is running. If it fails, it should launch docker desktop. My script works fine if I run from command line, but it fails when I run it by ...
KingKongFrog's user avatar
0 votes
1 answer
233 views

Script to notify via email when low on disk space

I found the below mentioned script on the internet, which notifies via email when server gets low on storage or as per defined. I run it every 5 minutes, if i am low on storage it keeps notifying me ...
Blohsh's user avatar
  • 3
2 votes
1 answer
125 views

Cron not running script on boot

The main idea is to make my pc run a script on boot in wich x11docker takes care of lifting a container with a youtube video. this is mi crontab -e: @reboot /usr/local/sbin/script-exo.sh script im ...
ømen's user avatar
  • 21
1 vote
1 answer
47 views

cron not working as intended

This works * * * * * export DISPLAY=:0; /usr/bin/vlc --play-and-exit /home/tc/Music/test.ogg But this doesn't 30 8 * * * export DISPLAY=:0; /usr/bin/vlc --play-and-exit /home/tc/Music/test.ogg I ...
The Meditation Center's user avatar
1 vote
1 answer
97 views

/usr/sbin/anacron kills dovecot and postfix

I am running dovecot and postfix on a 22.04.3 LTS Ubuntu server. Every day at 6:25 first the dovecot server and then the Postfix server gets stopped (it started about a month ago). It starts again ...
Lukas's user avatar
  • 41
0 votes
2 answers
314 views

cron unable to run .sh script - 22.04

I am trying to run a simple script that checks the battery percentage and shows it through a notification (notify-send). The script runs correctly if ran from terminal manually: ~/path-to-script/...
overmach's user avatar
0 votes
0 answers
23 views

How to alter screen dimming routine on Ubuntu 23.10? [duplicate]

My Android cellphone did the same thing. It had a mode/routine that kicked on every night. Some power feature.I edited the timer to go off at 3am and all has been peachy on my phone. Ubuntu is doing ...
brad's user avatar
  • 160
0 votes
0 answers
54 views

Crontab -l not reporting any jobs after /etc/crontab edit

I want to run a Python script at certain intervals. So I edited the /etc/crontab file and added this: */2 9-10 * * 1,2,4,5 administrator DISPLAY=:0 python3 /home/administrator/main.py So I want to ...
Mathias's user avatar
0 votes
1 answer
237 views

Why does my powershell script run with "pwsh" but doesn't with "sudo pwsh"?

I'm still somewhat new to Ubuntu / Linux so please bear with me if I'm not using correct terminology. I'm on Ubuntu 20.04 but I use Putty to perform everything via the terminal. I'm using a collection ...
tl6277's user avatar
  • 1
0 votes
1 answer
145 views

crontab -e stopped working for non-root user, /bin/sh: 1: mvim: not found, ubuntu 22.04

The command crontab -e has stopped working under non-root user accounts and gives the error: /bin/sh: 1: mvim: not found crontab: "mvim" exited with status 127 However, it still works for ...
Paul B's user avatar
  • 103
0 votes
1 answer
230 views

xterm: Xt error: Can't open display: :0

I have a cronjob that didn't work this morning. The line in crontab -e looks like this: 20 9 * * 1-5 export DISPLAY=:0 && /bin/bash /opt/ibc/twsstart.sh I couldn't find any errors in /var/log/...
Taylor's user avatar
  • 147
0 votes
0 answers
97 views

Is It Possible To Run A Command In A Running Cronjob [duplicate]

On my computer Ubuntu 22.04.3 LTS I'm hosting a minecraft server that starts and stops automatically using crontab. is there a way I can type a command (/tellraw ... for example) anytime by running a ...
PokePuff05's user avatar
2 votes
1 answer
742 views

cron command not working

As a super-user I crontab -e and add a line to source a cronsh.sh file like this: 0 0 * * * source /home/myname/cronsh.sh The content of the cronsh.sh file is this line: date >> /home/myname/...
SO_32's user avatar
  • 181
0 votes
1 answer
7k views

Install to php 8.0 the php8.1 and php8.2 and set for different sites in Ubuntu 22.04 and Apache 2.4.58

At the moment I have running PHP 8.0 with Mautic and Moodle on a VPS with Ubuntu Server 22.04. I want to install Suite CRM what needs php8.1 and another app who needs php8.2. How to install php8.1 ...
Stefan Franz's user avatar
0 votes
0 answers
134 views

sendmail error only when run as a cronjob

Ubuntu 22.04 This is puzzling me. I have a simple script that emails system status to me from a remote computer. The script runs fine from the command line. But when run as a cronjob, it doesn't work. ...
thatjackelliott's user avatar
1 vote
0 answers
58 views

Ubuntu gsetting at reboot

I want to run following gsetting at reboot because something resets it I don't know what some keyboard language changer setting resets it. gsettings set org.gnome.desktop.input-sources xkb-options [] ...
Aleksandar Pavić's user avatar
6 votes
3 answers
3k views

cron: 5/15 * * * * doesn't work (run every 15 minutes starting from 5 minutes past the hour)

*/15 * * * * works fine by running every 15 minutes starting from the top of the hour. I need a task to run every 15 minutes starting from 5 minutes past the hour. Several cron simulators, eg crontab ...
Old Geezer's user avatar
0 votes
0 answers
32 views

Postfix sends to wrong address

I have a cron job that sends a report out once a day. The server is configured with postfix and the mailutils, and mailutils-common packages. On 20.04, I was able to send emails out no issue like this:...
spikeypanda48's user avatar
0 votes
1 answer
126 views

Crontab with script to notify-send

I'm trying to set up a bash script which is send a gui notification when a file is created in a folder. Everything works when I launch it in terminal, but when I set up at boot with crontab, the ...
rhadamanthe's user avatar
0 votes
0 answers
719 views

How can I start firefox immediately on boot from the command line using cron?

I've got a Librecomputer Le Potato, a single-board computer in the style of Raspberry Pi, that I am trying to run Firefox on in kiosk mode. I want it to run Firefox immediately on startup, but since ...
Obliterax Scourge of Nations's user avatar
-1 votes
1 answer
121 views

endless reboot of ubuntu 20.04

I use Ubuntu 20.04.5 LTS with bigbluebutton. Yesterday at 8 am, ubuntu started to reboot uncontrollably every 9:27 minutes. I searched the Internet in a search engine, did everything possible, and ...
nikita chockov's user avatar
1 vote
1 answer
92 views

xfconf-query not working in crontab

i have a script as follow /usr/bin/disable-sleep #!/bin/sh xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0 now=$(date +"%D %T") echo "disable sleep $now&...
Hans Yulian's user avatar
1 vote
1 answer
410 views

Why Cronjobs Run According to UTC Time?

I am in Singapore and the server (Ubuntu 22.04 EC2 instance) is set according to the my local timezone (UTC+8H), at least so the date command tells me. $ date Wed Sep 20 09:07:42 +08 2023 Is this a ...
Della's user avatar
  • 505
0 votes
1 answer
126 views

Exit cron job after launching program

I have this .sh script that I want to execute once a day as a cron job. It checks if a specific process is still running (qbittools) and if not launches it again. This works, however the cron job ...
cmplieger's user avatar
  • 101
1 vote
0 answers
2k views

How to setup cron job

I am using Ubuntu 22.04 and have php-fpm, so I am using php8.2 and php7.3. I use 7.3 for Interspire Email Marketer, (IEM). In IEM, it found the cron path to be: /usr/bin/php -f /var/www/mail.domain....
Hawk007's user avatar
  • 159
1 vote
1 answer
1k views

Cron not working in the new EC2 instance. If run manually then it's working

I have set up a new EC2 instance. Everything is working perfectly. Now this morning I have set the cron and below is an example of cron */5 * * * * /usr/bin/php https://www.xyz.in/api/cron/index.php ...
user9437856's user avatar
0 votes
0 answers
36 views

Freeing up Ubuntu system resources?

I have an old laptop I run Ubuntu on. However the capacity of this pc is small, so I have to clean often. But opening the file with the commands, copying and pasting into the terminal, gets boring ...
SamirOnof's user avatar
1 vote
1 answer
234 views

Unable to run notify-send from cronjob

In my Kubuntu 22.04, a script run by my crontab uses notify-send. However, it doesn't work: there is no pop-up appearing. If I redirect the output (stderr in particular) of the script to a file, this ...
BowPark's user avatar
  • 929
0 votes
0 answers
106 views

How can I download songs from a spotify playlist to my desired folder all Tuesdays at 00:00 with spotdl?

How can I download songs from a spotify playlist to my desired folder all Tuesdays at 00:00 with spotdl?
dramonroca's user avatar
1 vote
0 answers
243 views

how do i change the top bar blur color change based on time? (blur my shell extension)

I have ubuntu 22.04 on my laptop with gnome 42.9. I use the whitesur theme to make my operating system look more similar to Macos by apple. I also use the"blur my shell" extension. how do I ...
adgy _omr's user avatar
1 vote
0 answers
70 views

The LAN device IP is not accessible when a SSH session is not running

Hi there I have a python script which reads data from different IP addresses in LAN, The script runs in a Edge Device with Ubuntu 20.04 LTS focal installed every 5 min using a CRON job. The problem is ...
Zain Ul Abidin's user avatar
0 votes
2 answers
183 views

Crontab is not working

Below is the content of my crontab: toto@toto-pc:~$ crontab -l # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with ...
TVG's user avatar
  • 327
2 votes
1 answer
195 views

Cron Job created by script to run another script on reboot - not working

I'm trying to have a script create a cron job that executes another script on reboot. For reasons I am yet to understand, I cannot get this to work. For the sake of simplicity, this is the snippet I ...
Edward's user avatar
  • 31
1 vote
0 answers
137 views

Why is CPU locking up?

Woke up this morning without a working computer. It had basically frozen, only on existing prompt still worked, and issuing "reboot" command didn't work. Strangely enough, things like ls -l ...
Eloque's user avatar
  • 111
0 votes
0 answers
86 views

Crontab command did not update the chef client node and did not automate the node? [duplicate]

Picture attached use this command to automate node * * * * * root chef-client enter but not working? kindly support
saad bin khalid's user avatar
0 votes
0 answers
196 views

Is there a way to run logrotate of a specific application's logs only at times other than midnight?

I put the file I set in the "logrotate.d folder". And I wanted to run the file only at 00:30 every day through "crontab -e". However, when I checked the next day, it was executed ...
john_smith's user avatar
4 votes
1 answer
654 views

Crontab never works on ubuntu server

I'm really new to ubuntu server, and i've been having a lot of issues with crontab across this week and i can't really figure out what's wrong with it, i tried everything i saw here to no avail. So, i ...
Ángel's user avatar
  • 49
0 votes
0 answers
766 views

Permission denied (13) with rsync command

I am trying to make a script that will eventually go into crontab to execute every once in a while. I want to backup a directory from my HDD to my usb drive. Here is the script: SOURCE_DIR="/...
spirledaxis's user avatar
0 votes
1 answer
3k views

Crontab permission denied despite user being listed in /etc/cron.allow

I'm attempting to run crontab as the "ubuntu" user on a machine running Ubuntu 20.04. I get a permission denied error despite the "ubuntu" user existing in /etc/cron.allow. $ ...
billy's user avatar
  • 1
0 votes
0 answers
364 views

Can't find Cron mail and cron jobs dont work

I have 2 scripts in crontab -e: 0 0 */3 * * /bin/bash /home/user/scripts/3day-san-backup.sh >> /var/log/3day-san-backup.log2>&1 0 0 */1 * * /bin/bash /home/user/scripts/1day-pny-backup....
spirledaxis's user avatar
0 votes
0 answers
656 views

Trying to run a script as a daemon on reboot using CRON in Ubuntu 22.04

As a workaround to the known bug in 22.04 LTS which does not turn off screen backlighting on inactivity, I found the following script: #!/bin/sh #Screen timeout script screen-lock-5-min.sh # #...
R Wissbaum's user avatar

1
2 3 4 5
44