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
0 votes
0 answers
16 views

Error message: "`RANDR Query Version' returned error -1" when calling redshift from a cron job

I get this error message when I'm trying to call redshift from a cron job; it's working well when I execute the script below manually: `RANDR Query Version' returned error -1 Initialization of randr ...
  • 1
0 votes
1 answer
33 views

upgraded from 20.04 to 22.04 - ubuntu locks me out of the ui for brief bursts

It feels like I no longer get ui events or can click anything. like there is an invisible window between me and all applications. I can get out of it by hitting the windows key and re-selecting any ...
  • 101
1 vote
1 answer
49 views

xmessage and cron

simple cron bash script which uses xmessage to alert the user to a specific condition. It works fine and does exactly as expected when I run it, but when I fire it off via cron, I get in syslog: (...
0 votes
0 answers
18 views

How to create periodic automatic reboot with jobs prior and after reboot?

Currently I have a Minecraft server running on a remote PC with Ubuntu server 22.04.1. I would like to create a job which would restart the PC itself while properly shutting down Minecraft server ...
3 votes
2 answers
320 views

Startup script not executing

Ubuntu Version: 22.04.1 LTS Hey! I'm trying to run startup.sh located in /root/startup.sh on startup. This is the content of the file: synclient VertScrollDelta=-100 synclient CoastingFriction=35 ...
  • 178
0 votes
2 answers
44 views

Ubuntu 20.04 @reboot cronjob doens't run script

I have a vultr server in a ubuntu so 20.04, i'm creating a bash script in the following dir /startupscripts/apilibro Inside of the script i need to start my directus server running yarn directus ...
2 votes
0 answers
59 views

Best way to watch the contents of a directory in near-real-time?

I've got a server with an external HDD, I download files to the main disk then transfer them over to the HDD for storage. I mostly do file management over WinSCP, but it's not possible to move files ...
0 votes
1 answer
49 views

Why does my crontab not run cron.daily scripts?

My crontab file is in /etc/ I have a folder: /etc/cron.daily with dbBackup_sh, logrotate and tmpreaper I run these 3 scripts manually every day with no problem. My crontab will not run the daily ...
2 votes
3 answers
546 views

crontab run every x hours vs run when modulo hour is zero

I have in my crontab the following 15 */4 * * * ... My original intent was that I would run ... every 4 hours from when the computer boots up. If I power on at 8 am, it would run at 8, 12, 16, 20,...
  • 261
-2 votes
1 answer
34 views

Cronjob scheduling

some string * 15 * * * /etc/script.sh If i declared a job in crontab by placing some string in the beginning after job schedule timings will it scheduled and run the job ?
  • 1
0 votes
0 answers
20 views

Using rtcwake, why does the logs say that the disks are stopped in the morning instead of the evening?

I have 30 23 * * * /usr/sbin/rtcwake -s 23400 -m mem in my root crontab. This runs at 23:30 and suspends the server and wakes it at 06:00. As a part of debugging a problem (the server doesn't seem to ...
  • 1
1 vote
1 answer
83 views

whats wrong with this cron job?

I set up a cron job to write a webpage every 50 minutes, but then I looked at the web page, and its blank. The cron job: 50 * * * * mkIndex.sh > /home/user/img/index.html mkIndex.sh is a script I ...
  • 14.1k
1 vote
0 answers
32 views

How to disable cron service delay on startup?

I'm trying to add the execution of a shell script on server startup. I do it using cron, so I configured it with 'crontab -e' command. It looks so: @reboot /home/user/run.sh Then I enabled a service ...
0 votes
0 answers
42 views

"tcpdump" command in "crontab" crashes immediately after running the "crontab" jobs

I want crontab to start a tcpdump command, but tcpdump seems to crash immediately after running the crontab jobs. This is the command that I am trying to run: @reboot /usr/sbin/tcpdump -l enpls0 -G ...
0 votes
1 answer
46 views

How to delete the root crontab in the GRUB command line?

I was experimenting something related to rtcwake in the root crontab, and the sleep worked correctly but I don't know what exactly went wrong, but now every time the PC boots up, the spinning loader ...
0 votes
1 answer
28 views

Crontab won't run bash cript

I have a bash script that takes backup of my gitlab server and copies the files to another disk. The script runs as expected when I run it by hand. I tried to add it as a job in crontab but it doesn't ...
0 votes
1 answer
42 views

how to clear crontab ubuntu cache memory

I started my server and configured the server without cPanel or direct admin. And to run queues in Laravel, I need to run cron, so I wrote the desired command in cron and everything works fine. Until ...
1 vote
2 answers
64 views

Cron job on ubuntu 20 does not stop until machine restart

I have this cron job in my crontab * * * * * while true; do curl https://example.com/Payments/cron_jobs_with_codeigniter --silent --compressed; sleep 5; done it works but when i empty the crontab and ...
  • 183
0 votes
1 answer
36 views

Possible to set crontab to run at a different timezone interval?

I have a bash script as part of my deployment process that looks something like this, and it installs different cron jobs to be run #!/bin/bash echo 'starting after_install.sh' ## unpack and install ...
  • 123
0 votes
1 answer
57 views

after a reinstall I'm having issues with OPcache Memcache Redis when Nextcloud tries to run cron

I had issues with mysql not being able to be updated. I ended up having to uninstalling it, which uninstalled a lot of other files and unfortunately I did autoremove. Anyways I did save a copy of what ...
  • 2,751
1 vote
2 answers
109 views

(r)sync between Ubuntu virtual machine and windows host using a shared folder (after start and before restart/shutdown

The host machine is windows. I have an Ubuntu virtual machine(vmware). There is a shared folder between Ubuntu and Windows. The shared folder is mounted in /etc/fstab: vmhgfs-fuse /...
0 votes
1 answer
26 views

To have a cronjob triggered both daily and upon reboot, do I need two separate jobs?

I have a line in the cronfile like this. @daily cd Model_Pipeline && bash deploy.sh>>deployment.log 2>&1 It is running everyday just fine, but I also want it to run upon every ...
  • 495
0 votes
1 answer
26 views

crontab job to open terminal and run command in new terminal

I'm using crontab to schedule python script but I want to open new terminal and run the command in it so I can interact with the terminal. The script involves browser automation, so I need to manually ...
0 votes
2 answers
41 views

Help understanding rsync command

Can someone help me understand the following rsync command, totally new to using rsync. rsync -av --progress --delete /exampledir/ root@192.168.0.100:/dir1/dir2/dir3/exampledir/ This command is in a ...
3 votes
2 answers
93 views

Run cronjobs in different timezones

I have some cronjobs that I want to run. I want two of my scripts to run in UTC and the rest in CET. I have tried with cron_tz but it does not seem to work.
0 votes
0 answers
33 views

MAILTO in crontab

My MTA is ssmtp. In crontab I have set the MAILTO line to my email address. What is the actual command that the MAILTO line triggers? Is it possible to modify it? I actually need to start ssmtp as ...
0 votes
2 answers
28 views

How to run remote crontabs?

We want to run a certain backup process via one server, basically like the following: Server 1 runs a process that copies data from Server 2 to the backup location. Is there a script that I can write ...
-1 votes
1 answer
21 views

crontab relative log path output not generated

10 5 * * * rm ./rehldslog && cd ./code/rehlds && rm -rf ./build && ./build.sh --compiler=gcc --jobs=4 > ~/rehldslog 2>&1 in the logs i can see (CRON) info (No MTA ...
  • 1
0 votes
0 answers
28 views

xconsole causing rsyslog to fail startup

I am trying to verify that a cronjob ran on WSL2. Sources have told me to check /var/log/syslog. When I navigated there, syslog did not exist. Sources then told me to run service rsyslog start to ...
7 votes
4 answers
3k views

How to replace cat with bat system-wide Ubuntu 22.04

I am using Ubuntu 22.04 with bash, pretty vanilla, and have added alias cat="batcat" to ~/.bashrc. The program batcat or bat being referred to can be found here: https://github.com/sharkdp/...
0 votes
1 answer
93 views

Running scripts on startup

I am trying to run a script as soon as my system starts. I am running ubuntu server version on an odroid M1. The script itself works when I use the command: ./StartJupyterNotebook.sh. However as soon ...
  • 1
1 vote
0 answers
17 views

Is it possible to see a python program working after it's launched by cron in Ubuntu? [duplicate]

This is something that has perplexed me and maybe there's a way to do it, but if you are running a python program from terminal it shows all the outputs. However when I run the python from cron, there ...
0 votes
1 answer
34 views

Script Isn't Working at Reboot

In this thread Temporarily Disable Touchscreen I asked how could I disable my HP touchscreen. By trial and error, and using the command xinput --list I was able to identify which device was the ...
0 votes
0 answers
29 views

Get crontab -l output into a text file

How can I get this to create a text file? I am getting a permission error. crontab -l > crontab_backup.txt
  • 2,676
0 votes
1 answer
72 views

644 Permission needed for /etc/cron.allow, workaround?

There is an odd CRONTAB behavior difference between Ubuntu and RHEL-derived (say, Rocky 8.x) distros. And, because security I need to understand it better. I've tested this issue in Ubuntu 18.04 and ...
0 votes
0 answers
106 views

Trying to execute a command on startup to automatically mount Google Drive via rclone but I can't get it to work

I have saved @reboot rclone mount cloudstorage: ~/Cloud/ at the bottom of crontab -e and it does not do anything. I have also saved a .sh file with rclone mount cloudstorage: ~/Cloud/ (so without the @...
1 vote
1 answer
135 views

My cron doesn't find a file

I have written a Python script that I would like to run by crontab! I have run the Python script individually and it works fine! The problem is that when I run it by Crontab, I receive an error ...
0 votes
0 answers
52 views

Cronjob log shows its execution, but the real script is not executed

I have seen these questions, but they have not solved my problem: Question about cronjobs/bash scripts which are not executed Cronjob script not being executed This is my /Temp/RunJob script: echo $&...
  • 109
0 votes
0 answers
331 views

speedtest ERROR: No matched servers: 4510 /* (4510 is the Server ID) */

I want to get speedtest status on Zabbix Server so after the Readme of "Zabbix Speedtest" mentioned in the Zabbix website https://git.cdp.li/polcape/zabbix/tree/master/zabbix-speedtest Here'...
0 votes
0 answers
26 views

Output of an cron controlled python script

normally i use 'logging' to send messages of my python script into the syslog. example: import logging logging.basicConfig(level=logging.INFO, format="[%(module)s] %(message)s") ... logging....
0 votes
1 answer
32 views

How can I name my log files according to the date?

I have tried to do something like date=date and then name my file $date.txt but the output was date.txt. Fun thing, I asked Copilot to help but I don't understand its advice and unsure how to fix it: ...
0 votes
1 answer
108 views

Sendmail to send system emails

Is there a way to send an email to my Gmail account, each time I get a system email from Ubuntu? I'm using Ubuntu 22.10 and has Sendmail installed and working (sending emails from/to my Gmail account)....
  • 1
0 votes
0 answers
28 views

shutter is not working as a cron job for taking screenshot

My requirement is to capture the screen shot of the desktop's users, Using the following script, but It is not working. Regardless of which user logged in,this script is running as cron job in root ...
  • 221
1 vote
1 answer
137 views

Problems on updating ubuntu 18.04

I just install ubuntu 18.04 in my laptop parallel with windows 10. When I tried to runsudo apt upgrade,error message. After I deleted all the upgraded files and upgrade again, it got stuck hereStuck ...
  • 19
0 votes
2 answers
64 views

How to sort files into directories and subdirectories by name

I am new in the world of Linux and I need some advice. I am continuously saving files in one folder in the following format: 20221021-164822-778711241-604184411.mp3 20221021-164911-778711241-607925196....
  • 1
0 votes
1 answer
54 views

How to Automatically run/stop a script at a certain time of the day

What I want to achieve: 8:00 AM: Runs a sh script (this script does not stop running until the user presses ctrl+c) 8:00 PM: stops the script by sending ctrl+c or other means Repeat I tried ...
  • 39
1 vote
0 answers
88 views

How to end a cpulimit on a process

I am utilising the very handy tool CPULimit to restrict the CPU usage of an import triggered in the cron of my Ubuntu server. Successfully limiting the process is not a problem, I am also able to ...
  • 131
0 votes
0 answers
52 views

crontab sees bash script running while it is not

I have a python file which should ideally run at all times. However, sometimes it crashes, so I would have to start it again. Therefore, I have a cronjob that should try to run every 5 minutes (if it ...
  • 101
0 votes
0 answers
106 views

Scheduling shutdown with cron

I want to use crond to shut down my system late at night in case I forget. robin@robin-OptiPlex-780: crontab -l 30 1 * * * /sbin/shutdown > $HOME/cronlog/cron.log 2>&1 robin@robin-OptiPlex-...
0 votes
1 answer
28 views

How to run URL after reboot system in Firefox via cron job

@reboot export DISPLAY=:0 && firefox start_http://127.0.0.1:1340/#/login?redirect=%2Fdashboard this one is not working

1
2 3 4 5
42