Questions tagged [cron]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
51 views

cron job for hour=7-19 runs every hour instead

Here is the job, intended to run every 15 minutes between 7AM and 7PM: */15 07-19 * * * /home/max/bashScripts/rsyncMe >/dev/null 2>&1 The job is running every 15 minutes every hour instead, ...
0
votes
2answers
31 views

Can I add comments to each entries in crontab after a crontab entry

We have bunch of crontab entries in crontab file. some of them are commented out temporarily. Is it possible to add a comment at the entry as the reason for commenting out. For example #00 20 * * * ...
1
vote
1answer
28 views

Full feature Linux scheduler

The scheduler cron processes outputs of programs only sending them via mails or writing them in files. So these outputs can't be assigned for example to a PHP variable (see this StackOverflow question)...
0
votes
0answers
23 views

Does tmux need a console?

I'm trying to automate the creation of a tmux session and windows within it running commands and have a script to do so and although it works fine when I run it from command line, it fails if I run it ...
0
votes
0answers
30 views

tmux from cron fails “lost server”

I have a bash script which kills and recreates a tmux session, which works fine run from command line, but when I run from cron the tmux kill works but the create session outputs "lost server&...
0
votes
1answer
5 views

wp.cli and sendmail not working via cron but do work when manually run

Not sure if this belongs on Wordpress Stackexchange or here. I think here as the last line in my code is not Wordpress specific. I have the following code in a .sh file which I run weekly using Cron. ...
10
votes
1answer
547 views

Should I use 1,15 or */15 in crontab to run a command every 15 days?

As I know crontab has those fields, starting by left to right. 1 minutes 0-59 2 hours 0-23 3 days of month 0-31 4 month 1-12 5 day of the week 0-6 6 command I want to run foo command ...
0
votes
0answers
29 views

Docker and cron is broken: can't lock /var/run/crond.pid

On my unRAID server, I am trying to run a Docker container with cron installed and enabled. Here is my very, very simple Dockerfile: FROM debian:buster-slim RUN apt-get update && apt-get -y ...
1
vote
2answers
54 views

why debian run cron scheduled task immediately after wake up from sleep?

I have a cron job that locks the computer using i3lock at a certain time (12:15), but sometimes I put the computer to sleep before 12:15. If I then I wake up the computer after 12:15 (usually around ...
0
votes
0answers
12 views

cron command does not work on node Docker image

So I am trying to make a few Dockerfile templates for my NodeJS scripts in unRAID. However, cron does not seem to be working that well.. not at all, in fact. No matter what (cron file empty for ...
0
votes
0answers
18 views

Redhat 8.3 cron job not running - pam_unix(crond:setcred): option remember not allowed for this module type

In my RHEL 8 server cron job is not running. systemctl status crond -l command giving below error message. Nov 18 19:29:01 server01 crond[702517]: pam_unix(crond:setcred): option remember not allowed ...
0
votes
0answers
26 views

cron script can't see files in Desktop

It appears that my script, when run via cron, does not see the contents of my Desktop: ~/Code/scripts/problem.sh: echo hello cd ~/Desktop echo $(pwd) ls echo hello2 Output when I run bash problem.sh ...
3
votes
1answer
82 views

Is it safe to call an environment variable from a crontab script?

I have a crontab script which read an environment variable with sensitive information(like a decryption key). The crontab entry is defined like that: 30 3 * * 5 VAR="pw" /usr/bin/script.sh ...
0
votes
0answers
27 views

How to write in /sys after boot

for my F- and fn-keys to work I need to run this command echo 0 | tee /sys/module/hid_apple/parameters/fnmode after every boot. So i wanted to start it with a crontab, but this somehow does not work ...
11
votes
0answers
128 views

Is POSIX wrong about crontab with non-asterisk month and day-of-week?

Background It is widely known that the UNIX cron runs jobs when either day-of-month or day-of-week matches, if both are specified with explicit values rather than an asterisk wildcard: 0 0 * * 1 # ...
0
votes
1answer
26 views

Cutting date from a file

Right now, I have a cron job that looks like this: */15 * * * * cp /home/server/server_log.txt /var/www/html/logs/`date "+\%d-\%b.txt"` >/dev/null 2>&1 It works perfectly. However,...
0
votes
1answer
59 views

Shell script not running with cron tab

My shell script is not running using cron tab. If I execute this script using sudo ./myscript.sh, everything works. myscript.sh : #!/bin/bash if ! cd /var/www/myfolderapps/myfolderapp; then echo '...
0
votes
0answers
28 views

Create cron job or schedule jobs using calendar

On my project, I need to run my script at a specific time. My script: 1.stop_instance_001.sh 2.change_instance001_m5.2xlarge.sh 3.start_instance_001.sh Example: I use fullcalendar web app to ...
1
vote
1answer
19 views

How To Run Specific Crontab File

I am using crontab to ring a bell in a specific time & date. Sometimes I need to set one schedule and sometimes the other. My plan is to create 2 different crontab files: 1.) The Original Crontab ...
0
votes
0answers
23 views

Best way to modify crontab during boot? (init-scripts)

I would like to add an entry to crontab at boot dependent on a condition. What is the best way to do this? Note that if the condition is not true I do not want the job to run. If the condition is true ...
0
votes
3answers
39 views

How to create a night mode with cron

Am using Iris Mini to filter the blue light at night, it works pretty well but having to execute it manually is annoying. So am trying to use cron to start it each night at 8PM. This is what i have ...
-1
votes
0answers
21 views

What's meaning of + + in the begininng of a set -x output line [duplicate]

When I turn on set -x in the cron.daily jobs or for /etc/cron.daily/ntp specifically, I have the following: /etc/cron.daily/ntp: + + sed -n s/statsdir \([^ ][^ ]*\)/\1/p grep -v ^# + cat /etc/ntp.conf ...
0
votes
0answers
11 views

Yum cron No package matched to upgrade: lynis-0:3.0.1-1.el7

I have some CentOS 7 servers, which update themselves by using yum cron. I use daily and hourly updates. I receive the following email message from 2 of them: /etc/cron.hourly/0yum-hourly.cron: No ...
0
votes
0answers
15 views

systemd-cron without the output-to-email part?

I always find it inconvenient using cron jobs on my laptop because of the MTA requirement. Today I find out about systemd-cron which converts my individual cron jobs to systemd services/timers, with ...
1
vote
1answer
36 views

Cron job doesn't run

I have a cron job which should run once a week to update, upgrade and autoclean apt, but it never seems to work, at least not as far as I can tell. This is apparent because running sudo apt-get ...
0
votes
1answer
36 views

Crontab -e simple problem

I was newbbbie of crontab command, and while i was investigating this command, i suddenly type some number and made my crontab -e look like this: pi@raspberrypi:~ $ crontab -e no crontab for pi - ...
1
vote
1answer
26 views

Crontab not running feh correctly on two screens in i3 (display variable set to :0)

I have two screens and I have a script to set a new wallpaper in i3 every day. The script basically downloads an image and then runs following command convert {save_location} -trim JPG:- | feh --bg-...
0
votes
1answer
37 views

Ubuntu 14.04 getting log in auth.log

I am getting error in /var/log/auth.log CRON: pam_unix(cron:session): session opened for user root by (uid=0) CRON: pam_unix(cron:session): session closed for user root Even I logged in with xyz user ...
0
votes
0answers
48 views

sed doesn't work under cron

My script: #!/bin/sh var=$(date) /usr/bin/sed -i "s|DATE=.*|$(/home/my/script $var)|g" /path/file Running this script manually works perfectly. As soon as it is ran from cron, in particular ...
0
votes
1answer
52 views

Setting EDITOR variable causes “E886: Can't rename viminfo file” when editing Crontab

I use Vim as my editor. I wanted to have syntax colouring when editing Crontab with crontab -e. I followed this answer. After setting variable EDITOR=vim and exporting it crontab -e now shows syntax ...
1
vote
0answers
34 views

Simultaneous running of script in several servers located in shared folder

I have a script (moves log file in backup dir) located in a shared folder that runs in ServerA. It is working as expected. I am planning to run this script in several servers, ie ServerB, ServerC, ...
2
votes
1answer
59 views

How to send a CTRL+C to a tmux pane using crontab?

How can I send a CTRL+C to my tmux tab using crontab? I have the following and it works for sending commands, but I'm not sure how to send a CTRL+C to it. 0,30 * * * * /usr/bin/tmux send-keys -t 0 &...
1
vote
0answers
143 views

cron.daily not running automatically

I've seen similar questions, but none of the solutions provided worked. All jobs within /etc/cron.daily are not running automatically. I'm on Debian 10. Here's the file list: me:~# ls -la /etc/cron....
0
votes
1answer
22 views

how to kill processes in shared host by automatically?

in shared hosting which allows maximum 25 processes. as it reaches 25 processes , site goes to 500 internal error. in cpanel i manually kill the process one by one . Which script can work to kill all ...
1
vote
1answer
43 views

BASH_ENV being ignored in AWS Ubuntu 20.04 crontab

With both SHELL=/bin/bash BASH_ENV=/home/ubuntu/.bashrc set on AWS Ubuntu 20.04.1 LTS crontab, .bashrc isn't sourced. I ran into this with the error /bin/bash: python: command not found. python is ...
1
vote
1answer
39 views

logout after 30 minutes inactive XFCE4

I have a little problem here but before we go as specifications, I use a Debian 10 virtual server on a VMware, GUI Xfce4, and users make terminal access to it via RDP That said, my idea is that when ...
0
votes
1answer
34 views

How do I create a cron to find and delete directories that are 90 days old but ignore 2 sub-directories?

What I have I have a cron currently setup that finds and deletes directories & files that are 90 days old What I need I would like the crontab to ignore two directories when deleting directories &...
0
votes
1answer
37 views

cron on centos creates only empty file

i know that this question has bin asked & answered a lot of times and i think i have read all of them :-( but still don't got it working :-( OK, using CentOS release 8.2.2004 (Core) in root's cron ...
0
votes
0answers
17 views

crontab @reboot for start command with input key

hello guys I need to create crontab linux task when @reboot and run command sudo service oracle-xe restart and other command , but this command need to input y to continue
0
votes
2answers
29 views

How to set cron job correct path to run a node.js script?

I'm trying to automate a Node.js file to run on schedule. But I can't get it to work. I'm using root user. This is the path to get to the file location from login: nodejs_projects/amazon_search_v2 ...
0
votes
2answers
100 views

sendmail Authorization failed in cron jobs

When I search for 'cron' using grep in /var/log/syslog I get some lines as follows: Oct 2 11:10:02 hplaptop cron[141532]: sendmail: Authorization failed (534 5.7.9 https://support.google.com/mail/?p=...
0
votes
1answer
61 views

Playing a sound using Crontab

I downloaded a music file named bell.mp3 and stored it in my /home/username/Downloads I was able to play it using mplayer sudo apt-get install mplayer mplayer /home/username/Downloads/bell.mp3 ...
0
votes
2answers
27 views

Can I see a list of jobs that cron runs @reboot?

In /var/log/cron.log I noticed that CRON runs "@reboot jobs" right after I start my computer. Is there a way for me to see the list of the jobs CRON triggers then?
0
votes
0answers
15 views

How to Use Crontab and Timestamp to Calculate Boot Drive Reboot Speed?

I wish to test my boot drives reboot speed. I plan to do this by running a bash script that reboots the drive 100 times and at each boot, gets the time stamp. With the time stamp, I can calculate the ...
0
votes
1answer
58 views

linux crontab + add shell syntax to crontab

we add the following line to crontab ( the script - test.bash should run every min ) * * * * * root [[ -f test.bash ]] && /tmp/test.bash the script is like that more test.bash #!/bin/bash ...
0
votes
1answer
46 views

Issue running python script from crontab?

I have a script /home/projects/temperature_logger/analyze.py that does some work on a temp.log file, which is really a csv of a date and the current raspberry pi temperature. This python script also ...
0
votes
1answer
17 views

Will path code in php work the same from cron?

Will php code which includes paths to files ( in a sub folder at the same location as the php script ) still work when the php script is run from a crontab ? My php code reads a text file from the '...
1
vote
1answer
11 views

Pi cron php not running

I can't get this cron to run. being new to linux, I really don't know my way around. Pi 3B+ Debian 9 Stretch PHP 7.0.33 Nginx 1.10.3 Pi has OpenMediaVault ( OMV ) running. Used OMV to create a ...
2
votes
2answers
43 views

Get files list with two extensions like deb|rpm|txt

I'd like to remove *.(deb|rpm) files from my Downloads folder on my Ubuntu machine every hour. I have this on my crontab * */1 * * * cd /home/alexalannunes/Downloads && ls *.deb > log.txt &...
0
votes
1answer
33 views

Help with crontab

I have this simple bash script for pinging my home server. In crontab I configured it to run every 2am. Then email me the ping result. The strange thing is, it always runs every minute no matter what ...

1
2 3 4 5
40