Skip to main content

Questions tagged [cron]

Cron is a job scheduler that allows users to run commands periodically.

Filter by
Sorted by
Tagged with
1 vote
2 answers
59 views

Crontab permission denied

I'm getting permission denied on crontab with any command I run and I don't know why. The crontab is configured directly by my root user. So I edit crontab with the root user with this command: sudo ...
Neptune's user avatar
  • 111
1 vote
1 answer
61 views

Running a cronjob that requires setting of several environment variables in particular directory

I need to setup Cron Job to run regressions for which I usually follow below steps in terminal: cd path/to/regression_dir/ source setup.csh perl "regression_script.pl" The setup.csh files ...
Rutuja14's user avatar
0 votes
1 answer
17 views

Starting pipewire on a server for a cron job

I have a cron job that plays an audio file using mpv on one of my home servers running Void Linux. I cannot hear any sound, until I ssh into the server and start pipewire manually, after which it ...
myTerminal's user avatar
0 votes
0 answers
105 views

Why can't root edit /var/spool/cron/crontabs?

[Please, I don't want to know why I shouldn't edit it; I want to know why I can't edit it] # pwd /var/spool/cron/crontabs # ll sysadmin -rw------- 1 sysadmin crontab 210 Jun 17 16:05 sysadmin # getcap ...
QF0's user avatar
  • 315
-1 votes
1 answer
93 views

What does "trap: SIGINT: bad trap" mean and how do I fix it?

I moved code to a new virtual server running Ubuntu 22. I have the following (edited to make names shorter) in my crontab so that it runs myCommand only if it is not already running: */1 * * * * ...
ferzle's user avatar
  • 3
0 votes
1 answer
46 views

centos7 cron job pam_limit invalid line hard nproc skipped

I am getting the error: May 29 19:15:02 vps3.domain.com crond[19846]: pam_limits(crond:session): invalid line 'user3 hard nproc ' - skipped May 29 19:15:02 vps3.domain.com crond[19846]: pam_limits(...
Onimusha's user avatar
  • 115
0 votes
1 answer
28 views

Crontab Expression Help

Need a crontab to run a job on the first Friday after the 18th of every month. I cannot for the life of me figure it out. Any help would be greatly appreciated. Thanks
Greg Barnes's user avatar
1 vote
1 answer
53 views

When sending email through bash script in cron it goes to root

Edit: I'm so embarrassed. I had a typo in the script name. So the email was crontab trying to tell me it couldn't find the script. So it was trying to email root because the cronjob failed and I set ...
philfry's user avatar
  • 11
0 votes
1 answer
28 views

Crontab run after deleting a file

I have a script thar I want to be executed each first minute of each hour. Thus, i made a second file named crontab.sh: $ cat crontab.sh #!/bin/bash #cript path script_path="/mnt/lap_c/home/...
Dimitris Tsiaousidis's user avatar
4 votes
4 answers
719 views

Unison via cron, how to deal with one job still running as the next one starts

I have a setup in which I sync files between two Linux servers using Unison over an SSH connection. This is implemented by running the following command via cron: unison -auto -batch PROFILE Changes ...
user149408's user avatar
  • 1,333
0 votes
1 answer
99 views

Raspberry-Pi 5 cron job not execute the command after reboot [duplicate]

I have newly Raspi 5, and I want to execute one .sh file to open Firefox after reboot. I didn't see any error in cron status! But the file not run after reboot. The file can run manually bash ...
M.Saeed's user avatar
2 votes
0 answers
47 views

locate in cron.daily not updating database

On a standard desktop installation of Ubuntu 24.04, when I try to use the locate command, searches for files that I clearly have in my home directory do not show up -- it appears as if the locate ...
Madeleine P. Vincent's user avatar
0 votes
1 answer
46 views

Are directories such as /etc/cron.daily and similar restricted by naming rules?

Mentioned in a comment in this post How are files under /etc/cron.d used?: People might miss, that "the file names must conform to the filename requirements of run-parts" (see Debian's man ...
xnl2d's user avatar
  • 17
0 votes
1 answer
187 views

crontab /bin/zsh: can't open input file: test.sh

I am trying to create a crontab to run a script: * * * * * cd /Users/test3/Desktop/Scripts/backup/ && /bin/zsh test.sh > /tmp/cron-output.log 2>&1 where test.sh is in /Users/test3/...
Mihail's user avatar
  • 41
0 votes
1 answer
113 views

Possible Malware: Unable to track starting point

For past couple of days I have been observing weird processes in one of our server. Most of the time I see multiple instances of executable 10 and sometimes 4 and takes a lot of cpu resources. When ...
Nazmul Ahasan's user avatar
0 votes
1 answer
18 views

Cron job with for loop, executing same command several times to create multiple threads

I'm trying to create a single-line /etc/cron.d/ cron entry, which runs the same command serveral times, essentially to create multiple threads, for long-running jobs: * * * * * usertorunas "for ...
fooquency's user avatar
  • 196
0 votes
1 answer
23 views

troubleshooting crontab not running

From the log it seems like it tries to run at scheduled time Apr 29 10:00:01 momspi CRON[13324]: pam_unix(cron:session): session opened for user admin(uid=1000) by (uid=0) Apr 29 10:00:01 momspi CRON[...
owen gerig's user avatar
3 votes
1 answer
58 views

how to execute cron jobs based on user's time zones

I'm facing challenges in implementing a cron job for our daily check-in feature. Our goal is to send a push notification alarm daily to remind users to check in if they haven't already. The timing of ...
beeeeeeginer's user avatar
2 votes
1 answer
146 views

Why is my crontab giving me a bad username error?

I'm trying to zip a directory and copy it over as a backup. I'm new to Linux to so I followed guides as best as I could, but when trying systemctl status cron I get the following error: Apr 27 13:34:...
Rexor's user avatar
  • 23
0 votes
1 answer
49 views

start command at given time interactively in terminal

is there similar command to sleep, but where I can specify given time, so that my command will start at given time, INTERACTIVELY in my current open terminal window? I know about at command, but that ...
Martin Vegter's user avatar
0 votes
1 answer
23 views

Inherit permissions not working with crontab copy

I have a copy script that runs in a crontab and I need the folder and files that are copied to inherit the permissions of the destination directory. This is the destination folder: drwxrwxr-x 10 usr1 ...
user1624184's user avatar
0 votes
2 answers
64 views

How to modify $PATH globally

On my Debian server I use crontab to schedule a python code. The problem is: when I add a line like this: 6 9 * * * python /path/to/daily_task.py &> $HOME/out.txt Not too surprisingly the ...
user9102437's user avatar
0 votes
2 answers
24 views

How to read a pin state on a Raspberry Pi and select (either/or) between two entries in a cron file?

So I built an MLB scoreboard with a RPI 3. Right now the display can either show my favorite teams playing, OR all the teams playing and cycle through them as they are going on. I would like to add a ...
Joe Schmo's user avatar
2 votes
1 answer
124 views

Multi computer cron

I have many computers and I ssh between them. I have a single cron file, which I manually type after into each computer. And when I change this cron file, I have to manually ssh into each computer to ...
john-jones's user avatar
  • 1,736
0 votes
0 answers
54 views

Unable to start cronservice as www-data user

I am trying to start cron-service using www-data user in Docker, it says Starting periodic command scheduler: cronseteuid: Operation not permitted failed! Below is the Dockerfile FROM php:8.2.12-fpm@...
Naveen Naidu's user avatar
-1 votes
3 answers
128 views

cron "@reboot" schedule not executing network configuration script

Version: Ubuntu 20.04.6 LTS In my crontab I have the following: @reboot /home/<user>/startup.sh Other output: <user>@eveng-gcp-v3:~$ ls -la | grep start -rwxr-xr-x 1 root root ...
Strider's user avatar
1 vote
1 answer
95 views

Shutdown command vs cron jobs

I have a number of computers and each computer is starting cron jobs left and right. Those are both server computers and desktop computers. On desktop computers it would be inconvenient if a user ...
john-jones's user avatar
  • 1,736
0 votes
1 answer
163 views

Can't run crontab with users other than root

My goal is to run a Docker container that contains crontab. So I want, as a non-root user, to be able to run scheduled crontab jobs. I am running the following Docker image: FROM openjdk:8 RUN apt-get ...
FueledByPizza's user avatar
1 vote
0 answers
23 views

How to get a daily report of the exit codes of cron jobs

I have a few dozen cron jobs, which run every day, for backups. I don't want to receive an email for only failed jobs, as I won't know when the email fails. I don't want to receive an email for every ...
fadedbee's user avatar
  • 971
0 votes
0 answers
56 views

cron task can't read from a network drive (wsl)

I want to define a simple cron task that gets list of files and directories available in a specified folder and saves it to a file. Here's the output of crontab -l 30 * * * * ls /mnt/q > /tmp/test....
LA.27's user avatar
  • 113
0 votes
1 answer
61 views

How to detect if a process runs longer than X seconds, then do something with it?

I’m on debian. I am calling a ffmpeg process to generate a mp3. this gets called from a php script using shell_exec. This works fine 99% of the time. Sometimes, the ffmpeg process doesn’t exit and I’m ...
frumbert's user avatar
  • 125
0 votes
1 answer
52 views

Cannot automate with cron the changing of the configuration with dconf on Debian (it worked on Ubuntu)?

This script worked in adjusting the background color and the font color in gnome-terminal when run from cron on Ubuntu 22.04 LTS. #!/bin/bash detect_dstr() { distribution=$(grep -E '^ID=' /etc/os-...
John Smith's user avatar
0 votes
2 answers
90 views

Cron, python and saving to a file

I've got a veeery simple script written in python that tests my internet connection na saves parsed data to a json file: #!/usr/bin/python3 import subprocess, json, os from datetime import datetime # ...
Trendkiller's user avatar
0 votes
2 answers
116 views

Crontab doesn't open for user

When I am trying to open crontab I see the next output: ubuntu@macaroon:~$ crontab -l crontabs/ubuntu/: fopen: Permission denied When I add sudo it opens fine however, if the jobs don't work there: ...
catch23's user avatar
  • 221
1 vote
1 answer
37 views

suppress cron emails from cleaning systemlog if 0B were cleaned

When cron runs 0 16 * * * journalctl --vacuum-time=10d I get an email with the content like Vacuuming done, freed 0B of archived journals from /var/log/journal. Vacuuming done, freed 0B of ...
rubo77's user avatar
  • 29.4k
0 votes
1 answer
133 views

How to run a fish alias from cron?

I have set up a fish alias for some commands that I frequently need to run manually. Now, I want the same commands to be run regularly. How can I set up cron to automatically run a fish alias?
Thomas's user avatar
  • 166
0 votes
0 answers
28 views

espeak ouputs no sound when ran from script running in the background

I have a cron job running a script every hour. The script contains this espeak entry: espeak -v mb-fr1 -s 120 "Snapshot" --stdout | paplay When the shell script is run normally in a shell, ...
Faxopita's user avatar
  • 179
0 votes
1 answer
139 views

How to make crontab interact with session of currently logged-in user?

THE PROBLEM Crontab does work - but just aside, not in interaction with users. How to make crontab talk to currently logged-in user by automatically perceivable prompt output? For example, a wake-up ...
futurewave's user avatar
0 votes
3 answers
38 views

Monitoring 100+ services

I have got a lightweight service like 2MB binary, that runs on user units but I have running like 120 similar services but using a slightly different config on each service. I would like to monitor ...
Casper Netherlands's user avatar
0 votes
0 answers
120 views

Write output of multiple python scripts to single file

I used to have only one python script, of which the output would be directed to a log file. It works like this, I have it in the autostart, using crontab. @reboot /bin/sleep 30; sudo /usr/bin/python3 -...
Dahlin's user avatar
  • 1
0 votes
0 answers
63 views

Scheduling wine exe using cron job raises error

I have been trying to schedule an exe file which runs an underlying python script. When I run it manually (wine sample.exe) on Debian Linux, it runs as expected, however when I run it using cron, it ...
AbhiGupta's user avatar
  • 101
0 votes
1 answer
30 views

crontab confusion

I'm having trouble understanding the following cronjob from geeksforgeeks crontab page: 30 08 10 06 * /home/maverick/full-backup I understand it executes at 8:30 AM on June 10th but the last * is ...
Mathew's user avatar
  • 243
0 votes
0 answers
25 views

How get current date in VARIABLE and display it in the name log-file in crontab? [duplicate]

The bot on this forum considers my thread to be a duplicate. However, the solution that is proposed does not answer the main question: how, USING A VARIABLE to output the date or the output of any ...
sivsoft's user avatar
0 votes
0 answers
52 views

tmux not starting a python script from cron

I am having issues with cron (Debian bullseye - Raspberry Pi 4) not starting a tmux session from a bash script I gave it to run on @reboot. Here is the problematic fragment of my bash script: ...
Kuba0040's user avatar
0 votes
2 answers
74 views

How do I declare and use a variable in crontab that will hold the name of the admin user account?

I want the crontab for root to be agnostic, i.e. I don't want to literally specify in it that the admin user is jim. That is why in my crontab for root I introduced the variable au. SHELL=/bin/bash ...
John Smith's user avatar
0 votes
1 answer
140 views

shell .sh script does not execute all tasks within, except when run manually [duplicate]

I run a shell script at reboot, by having it in my crontab: @daily apt-get update && apt-get upgrade -y @reboot bash /root/Start.sh @reboot /bin/bash -c 'sleep 10 && /bin/mount -a' ... ...
Marco's user avatar
  • 101
0 votes
1 answer
62 views

Trying to periodically backup /var/log while using journald

I'm trying to periodically backup my /var/log directory, but journald manages the logging on my system. Is the correct way to just tar -cf log.tar /var/log? The way journald saves it's log files in /...
user9503's user avatar
0 votes
1 answer
237 views

Anacron doesn't appear to run anything on Debian, but why? [duplicate]

I have an odd problem with my Debian server. Up until a few weeks ago, anacron was running my cron jobs fine and I can see I have backups from then so it was running stuff. Then it appears to have ...
Jez's user avatar
  • 1,006
0 votes
1 answer
64 views

Allow cronjob to restart systemclt user unit

I have a systemctl user unit: [Unit] Description=my app Wants=network.target After=syslog.target network-online.target [Service] Type=exec ExecStart=/home/user/bin/myapp StandardOutput=append:/home/...
Mark's user avatar
  • 733
0 votes
0 answers
67 views

Systemctl Suspend Inside Cronjob

I have a cron: * * * * * /usr/local/bin/script 2>/tmp/cron.log And the script: #!/bin/bash if <some validation>; then systemctl suspend fi So I get the error when cron executed: Call to ...
rhuanpk's user avatar
  • 415

1
2 3 4 5
48