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
19 views

Cron reboot job which starts new screen session is not executed [closed]

I want to execute the following job on reboot: sleep for 30 seconds start screen session send and execute python script (which requires sudo) in this screen session This is what I did: Added to sudo ...
  • 109
0 votes
0 answers
22 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 ...
-2 votes
0 answers
27 views

How to run Cron script in hidden directories and other folders with Root privs

I'm trying to create a cron script to delete files in a hidden directory and another directory as root (to delete files you can only delete with elevated privs) Namely the hidden folder '.Cache' and ...
0 votes
0 answers
21 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
49 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
44 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
71 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
16 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
31 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
54 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
20 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
50 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
59 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
51 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 ...
  • 29
1 vote
0 answers
29 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
64 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
21 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
0 votes
1 answer
2k views

Git "fatal: detected dubious ownership in repository"

Description: Ubuntu 22.04.1 LTS Release: 22.04 I'm trying to cron some git commands under the user www-data and it doesn't work. To troubleshoot, I tried to run sudo -u www-data git show ...
  • 11
-1 votes
1 answer
24 views

Cron job stopped running

This cron job has stopped working. It last ran on Sep. 27. # Empty trash every 120 minutes */120 * * * * /home/andy/bin/emptytrash60.sh Content of emptytrash120.sh: Trash_Log=/home/andy/Downloads/...
  • 2,547
-1 votes
2 answers
38 views

Shell file execution on crontab is not working

When I try the command sudo /bin/sh /var/www/domain.com/file_sync.sh in the terminal, It is getting executed successfully without any errors. But when I try to execute the same command from crontab it ...
2 votes
1 answer
142 views

Bash redirect doesn't work in Cron

I'm trying to redirect STDOUT and STDERR with &>> in my cron job, but I'm not seeing anything in the log file. The file is being created on the first run, but no OUT or ERR. When I run a ...
  • 25
0 votes
1 answer
38 views

Does cron depend on systemd for starting?

I'm learning about cron and systemd to schedule scripts. Each can be used independently to schedule scripts. I'm curious to know whether cron depends on systemd to keep itself alive? For example at ...
  • 119
0 votes
2 answers
250 views

Crontab is not running python scripts

crontab is not working, and I have 0 ideas why. I have a simple python script that I'm trying to run every minute when I run the file from the terminal, it's working with no problem. from datetime ...
0 votes
1 answer
44 views

Copy pictures from ubuntu folder to google drive folder

I am trying to make a crontab schedule to copy all picture files - steam screenshots - to my google drive account, then back them up to my home server. So far I have "cp - R /home/(user)/Pictures/...
2 votes
1 answer
44 views

Cronjob not running - I tried many suggestions from StackEx - still nothing

I'm about to descend into madness over a cronjob I'm trying to set up. I cannot for the life of me (after spending many hours/effort) figure it out, hope you can help. I have a Python script at /...
1 vote
1 answer
43 views

Play Movie On Boot

I'm wanting to automate a cinema with Linux. I would like to Play an MP4 on repeat directly after boot. I currently I have a solution with Windows using a batch file that runs on startup and issues ...
  • 113
0 votes
0 answers
33 views

How to configure a crontab to rsync via ssh on AWS using a pem file

I have two AWS EC2 server. One is production and the other is a replica. This command works from the command line. rsync -razv -e "ssh -i /home/ubuntu/migration/healthy.pem" /home/ubuntu/...
0 votes
1 answer
72 views

Why crontab is using different timezone than my local timezone?

My crontab looks like PATH=/RunCloud/Packages/apache2-rc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin # some commands here Output of date ...
  • 1,040
0 votes
1 answer
20 views

how to restart coldfusion using cronjob

I restart my ColdFusion service by this location /opt/coldfusion2018/cfusion/bin/ than I execute ./coldfusion restart so I want to set in a cronjob so what is a correct way to set it Is this the ...
0 votes
1 answer
63 views

gio operation not supported in a cron task

I have a task (script) that I added via crontab -e (Ubuntu 20.04). The task uses gio to copy a file in /tmp (that was created a line before in the script) to Google Drive. Running the gio command in a ...
  • 131
3 votes
3 answers
920 views

Why is my crontab script not working?

im trying to run a script stored in my home directory via crontab, but it's not working. The CRON log just says this every time it's running: Sep 3 18:30:01 backup CRON[6778]: (root) CMD (/home/...
1 vote
1 answer
283 views

crontab -e No such file or directory

I have a fresh instance of Ubuntu 20.04.4 LTS. I have not used or messed with the crontab previously. When I run crontab -e I get crontabs: No such file or directory. When I try to re-install crontab ...
  • 33
0 votes
0 answers
249 views

cron not running all cronjobs

I recently had to recreate our web-server from a backup image, and for some reason, some of the cronjobs are not working, where they did work before the restore. The server is running Ubuntu 22.04 The ...
0 votes
0 answers
35 views

Help creating script to run Valheim at system startup/reboot

Running Ubuntu Server 20.04.4 LTS Ive used crontab to create @reboot for other games that work. The issue i run into is that Valheim has a start_server.sh script that needs to run. I just dont ...
0 votes
1 answer
261 views

run script after reboot

I have the following script that should run mongo DB server and run my application after reboot here is the script that I wrote : sudo systemctl restart mongod cd airnotifier/ sudo python3 ./app.py ...
0 votes
0 answers
85 views

run script in cron job that contains sudo

I need to write a script that will restart the DB server and run the application I know how to write the script and how to make it in crontab to run after a reboot my problem that I need to do some ...
0 votes
2 answers
102 views

Code does work in terminal but not in Crontab

I'm no expert but have found a solution to send my data from the solarboiler (MK2) to domoticz. But when i paste the code in crontab only step 1 will execute. Step 1 0/1* * * * * wget -O /home/pi/...
0 votes
1 answer
165 views

How can I create a new screen session and execute a command, but leave the screen there?

Hi guys I am trying to get my Minecraft server to startup with my server. I will use cron once I figure out what the proper commands are. I want Minecraft to start in a new screen titled "...
  • 669
0 votes
0 answers
21 views

Sudo options question [duplicate]

I need to run a command that requires sudo to run and I want to run it in crontab -e the command is sudo java -jar WurmMapGen.jar but it asks for a password. I want this to be an automatic ...
0 votes
1 answer
38 views

running wscat from CRON - no output

I'm trying to get some data from a network device via a web socket. On the command line, the command works fine. But when executing from cron the only thing that happens is the output file is ...
  • 151
0 votes
1 answer
186 views

Crontab job that compresses file with timestamp

Ubuntu (Oracle VM virtual box) I got an assignment to write 3 crontab jobs as follows: logger - job that prints the date into /var/log/myDate.log every 30 minutes archiver - job that compressed /var/...
0 votes
1 answer
114 views

one of the python scripts is not running at the boot time as it takes the input from the server

I have four python scripts which runs at the boot time. I have written a shell script where in it includes all the four python scripts My shell script is as follows: sudo nano launcher.sh #!/bin/sh ...
  • 1
0 votes
0 answers
23 views

Cron Job Syntax Help [duplicate]

I have a cron job on Ubuntu Server 20.04.4 LTS defined to send me an e-mail containing the results of a shell script as follows (redacted): # Weekly Fail2Ban Status Report 0 2 * * 7 /home/myuser/bin/...
0 votes
1 answer
34 views

Command 'chrontab' not found No manual entry for chrontab (pip install?)

Ubuntu 22.04 My chron service is running. Jul 23 08:01:31 blah CRON[65443]: (CRON) info (No MTA installed, discarding output) Jul 23 08:01:31 blah CRON[65443]: pam_unix(cron:session): session closed ...
0 votes
1 answer
557 views

Bash: run a python script only if it's not already running

I have a python script to do some auto works hosted in a Ubuntu 20.04 server I use the crontab to run it every 10 minutes , but the script is run twice and I have to kill the second one regularly. Is ...
2 votes
2 answers
473 views

How can I run script on reboot that restarts a service and starts a GUI application?

I've set up a server running Ubuntu 20.04, and if for any reason the power fails or it is rebooted, I want to be able to have a script run automatically that will do the following; sudo systemctl ...
1 vote
0 answers
79 views

shutdown after @reboot cron daemon script runs

I have an ubuntu computer, which is running on a dell990 pc: uname -a Linux dell 4.15.0-188-generic #199-Ubuntu SMP Wed Jun 15 20:42:56 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux i want the computer to ...
  • 131
0 votes
0 answers
408 views

Transmission Gtk-WARNING **: <time> cannot open display: :0.0

Ubuntu 22.04 I'm trying to use crontab to launch Transmission at 22:04 and kill it at 07:00. To launch it at 22:04, I use: 04 22 * * * env DISPLAY=:0.0 transmission-gtk But I get the error: (...
0 votes
0 answers
189 views

Crontab in AWS ubuntu not running my task

We have an ubuntu instance in AWS and we tried with a simple command in crontab but nothing is happening. We checked and found the service is running.We tried with other ID and Root but no luck we ...

1
2 3 4 5
42