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

learn more… | top users | synonyms (1)

3
votes
0answers
41 views

My crontab only likes five asterisks

I have a problem with a user. Crontab refuses to run any job unless it's scheduled to run every minute (* * * * *). An soon as you edit the task to run, say, on minute 15 of every hour it fails to ...
0
votes
1answer
19 views

Tell guest OS to use my dockerized mail server to send email

I have postfix running in a Docker container. A cronjob try to send email, but reply “(CRON) info (No MTA installed, discarding output)” error in the syslog According to this link, the solution is ...
0
votes
0answers
10 views

Security guideline - permissions of /etc/cron.allow set to 600 [on hold]

The security guideline that my company follows (CIS Ubuntu 14.04 LTS Server Benchmark) states that users should be explicitly added to /etc/cron.allow and that file should have permissions set to 600 (...
0
votes
2answers
29 views

CentOS - cron service dies every few days

I am on using CentOS 6.7 server and every few days my cron service dies. I've tried checking: cat /var/log/messages | grep cron but there was nothing relevant. How can I check what's killing the ...
1
vote
1answer
28 views

passphraseless access to rsync with ssh through cron fails

I have setup ssh keys without a passphrase (Ubuntu) and copied them to my remote server (Centos6). I can login with ssh without a password successfully under my username. When I execute the ...
1
vote
0answers
34 views

Cron script output not able to log in specified folder [on hold]

I have a Linux script and I want to test whether the implemented script is working or not. I have scheduled a Cron job but I am not getting any output in the log folder. I have tried checking whether ...
5
votes
1answer
53 views

The user x cannot use this program (crontab)

Ubuntu 14.04 I don't understand the behaviour I'm seeing with setting up crontab for a service (no login) account (named curator). When I'm logged in as root, this is what I get: # crontab -u ...
2
votes
4answers
68 views

Add something to crontab programmatically (over ssh)

I have a deployment script, it must add something to a user crontab (trigger a script that clean logs every XXX days), however this must only be done during the first deployment, or when it needs to ...
0
votes
0answers
26 views

Crontab and python script

On raspian I created a crontab file using the following command: sudo crontab -e Added the following lines to cron @reboot sudo /etc/init.d/cron start 0 * * * * sudo /usr/bin/python3 /home/pi/dev/...
4
votes
2answers
60 views

Best way to ensure that a script is run once a period?

I need a certain script to run once a month (others viewing this question may need it to be run once a day/week/year/5-day, etc). I know I can use cron to do so with: 0 0 1 * * ./script.sh But what ...
1
vote
1answer
35 views

Can not connect to the host itself

Well, the problem is simple. I have the site based on apache and trying to execute cron job at this site from the same server. Let's say my site http://example.com and cronjob is /usr/bin/curl http:/...
2
votes
1answer
16 views

How do I set tmux's window size in a session started by cron?

In my crontab, I reference a shell script, print-size, that contains the following lines. #!/bin/sh tmux new-session -t check-size -d tmux send-keys -t check-size 'echo $COLUMNS $LINES' C-m When ...
1
vote
0answers
33 views

mutt doesn't run as a cron job wrapped in a bash script

mutt runs correctly like this: $ cat /home/user/test this is a test $ mutt -s "test" to@destination.org </home/user/test If I put this inside a bash script (stored in tmp1): #!/bin/bash /usr/...
0
votes
1answer
28 views

What is Alternative of initlog (present in RHEL5) but deprecated in RHEL6?

I am using initlog tool in a cron file to write the output of ntpq -p command in syslog.. But initlog command has been deprecated in RHEL6. Now, I want know the alternative of initlog command in ...
2
votes
2answers
730 views

don't log cron events in auth.log

In my /etc/rsyslog.conf, I have the following line to log the auth facility into /var/log/auth.log: auth,authpriv.* /var/log/auth.log but the file is flooded with cron logs, such as these:...
0
votes
2answers
40 views

Problem using ssh with crontab

I need to establish a permanent ssh tunnel between private server behind firewall and a public server so that I can ssh into private server anytime via the public server. When I manually execute this ...
0
votes
2answers
940 views

Arch Linux - How to run a cron job?

I am on Arch Linux and I'm trying to make a cron job that fires every minute. So I use: $ crontab -e And add the script in: * * * * * Rscript /srv/shiny-system/cron/CPU.R ~ ~ "/tmp/crontab.8VZ7vq" ...
1
vote
2answers
122 views

Crontab never running while in /etc/cron.d

Here's what I did on Debian Jessie: install cron via apt-get install cron put a backup_crontab file in /etc/cron.d/ However the task is never running. Here are some outputs: /# crontab -l no ...
0
votes
4answers
1k views

crontab not running for Fedora 23

UPDATE 2 This is a documented issue in Fedora 23. I used the workaround listed here https://bugzilla.redhat.com/show_bug.cgi?id=1263328. It looks like it is working. UPDATE I set selinux to ...
1
vote
2answers
70 views

How to use exit status in crontab

I add the following script line to the red-hat crontab, script should run on Saturday in 5:00 in the morning. In order to run the script /var/scripts/PLW.pl every Saturday at 05:00 morning. I want to ...
-2
votes
1answer
22 views

Halt the server daily at a specific hour

I have a CentOS 5 server, I want it to halt DAILY at 21:00 and wake up DAILY at 8:00 For the wake up I did it in the bios, but for the halt I want to configure it through cron. How to do it with SSH? ...
0
votes
0answers
9 views

What am doing wrong with this systemd/Timers setup?

I want "bot.sh" to be executed every 15 minutes. What am I doing wrong? /etc/systemd/system/redditbot.service [Unit] Description=reddit bot anti_anti_adblock [Service] Type=simple ExecStart=/home/...
2
votes
4answers
345 views

Move in crontab -e editor

I'm trying to manipulate the editor of crontab but it's really really confusing. So I launch the creation of a new crontab with crontab -e Then the default editor opens. Now from there, it's seems to ...
0
votes
2answers
1k views

Centos7 - crontab not running

I want to write a crontab that opens a firefox every minute (just to test it, i know it doesn't make any sense) My problem is that even though crontab is active nothing happens. This is how my crontab ...
-1
votes
2answers
46 views

how can I see if my cron is running and doing the job?

how can I see if my backups is saved after the minute assigned? how can I test it if it's ok?
0
votes
1answer
29 views

Linux redhat crontab + run script with arguments

I add the following line to the red-hat crontab in order to run the script /var/scripts/info_from_all_sites.bash every Friday at 00:00 night script should get as argument the file - /var/RT/names....
1
vote
2answers
44 views

Inline Crontab Commands?

Is the following crontab possible? 0 4 * * * /sbin/sudo shutdown -r now I want to run a single command, sudo shutdown -r now, from a crontab without having to put it in a bash script.
0
votes
1answer
34 views

Cron job not logging?

Ubuntu Server 14.04 LTS, and I've got the following in a crontab: 00 06 * * 1-5 /usr/local/bin/scribe /etc/local/scribe.1.conf 1&2>> /var/log/local/scribe.1.log 00 15 * * 1-5 killall scribe;...
2
votes
1answer
2k 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 ...
1
vote
3answers
184 views

about executing a python program in a shell script which is scheduled on crontab

i have a problem with regards on crontab. I have a script named checker.sh and i want to schedule it that would run every minute: * * * * * sh /home/pi/checker.sh so i have the script here: the ...
3
votes
2answers
963 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 ...
9
votes
5answers
9k views

Check if script is started by cron, rather than invoked manually

Is there any variable that cron set when it's running a program ? If the script is running by cron, I'll skip some parts; otherwise invoke those parts. How can I know if the bash script is started by ...
21
votes
6answers
64k views

Why did my crontab not trigger?

I used crontab -e to add the following line to my crontab: * * * * * echo hi >> /home/myusername/test Yet, I don't see that the test file is written to. Is this a permission problem, or is ...
3
votes
1answer
227 views

Fetching all Git repositories in the background

I'm thinking about setting up a cronjob for fetching all my repositories every once in a while, to have the current status ready in case I'm offline. Something like the following (wrapped for better ...
8
votes
4answers
23k views

How do I get (only) the http status of a site in a shell script?

I figure curl would do the job. I wrote in a script: #!/bin/sh function test { res=`curl -I $1 | grep HTTP/1.1 | awk {'print $2'}` if [ $res -ne 200 ] then echo "Error $res on $1"...
0
votes
1answer
2k 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 ...
54
votes
3answers
199k views

How can get a list of all scheduled cron jobs on my machine?

My sysadmin has set up a bunch of cron jobs on my machine. I'd like to know exactly what is scheduled for what time. How can I get that list?
3
votes
4answers
4k views

set up local mail delivery to user from cron script

A line in my cron.daily script not work as expected. I haven't any special smtp mail server in system, this line rsync -avun --inplace /oneuser/file.xls /otheruser/file.xls| mail -s "$0 $?" ...
0
votes
1answer
44 views

Deleting a file after X days does not work [duplicate]

I've tried multiple ways of writing this and I'm executing the script myself so it isn't the crontab that isn't working. These are examples of what I've tried : find /home/backups -mtime +1 -exec rm {...
1
vote
2answers
57 views

What the heck is going on with my cron scheduler? (rsnapshot)

CRONTABS I'm using rsnapshot with cron. Here's what sudo crontab -l shows me. 0 */4 * * * /usr/bin/rsnapshot hourly 30 3 * * * /usr/bin/rsnapshot daily 0 3 * * 1 ...
5
votes
1answer
94 views

When I schedule a command with 'at', can I change where the output is mailed to?

When I schedule a job/command with at to be executed in the future, the standard output and error of the command is "mailed" to the user that did the scheduling. So after my job runs, I get a message ...
44
votes
10answers
86k views

How can I run a cron command with existing environmental variables?

How can I run a cron command with existing environmental variables? If I am at a shell prompt I can type echo $ORACLE_HOME and get a path. This is one of my environmental variables that gets set in ...
6
votes
3answers
4k views

What could cause a cron to run twice at the same moment?

I have a cron that is setup to run every Monday at 1 AM 0 1 * * 1 /script/dir/script >> /script/dir/file.log After two years of running as expected, it ran twice on June 18, with the second ...
1
vote
2answers
2k views

How can I get crontab to use a different PHP installation location?

I have a MAMP setup which runs PHP 5.3.5 on my Mac OS X 10.5 computer. I am trying to install a crontab that executes a PHP script, which is located on my MAMP server. I can only get the crontab to ...
1
vote
1answer
61 views

Calling mailx from crond

I had a problem that gmail was blocking emails sent using mailx. I solved this by setting up an appropriate ~/.mailrc, which looks like: set smtp-use-starttls set nss-config-dir=/home/theuser/.certs ...
2
votes
0answers
19 views

flock command wont run through cron [duplicate]

I am trying to cron an rsync sync over ssh, but for some reason, as soon as I put the command in cron, it won't run. I don't know what is causing it to break, but it is certainly something related to ...
7
votes
2answers
7k views

Can I automate tar's multi-volume-feature?

Ok, so I've just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a quite nice multi-volume feature, although when I try it ...
2
votes
1answer
222 views

Cron job running but not establishing tunnel

I have a script which establishes a reverse tunnel on an endpoint HostB. It looks like this: cat tun.sh #!/usr/bin/env bash # Test code /usr/bin/ssh -V 1> /home/userA/bin/tun.stdout 2> /home/...
1
vote
1answer
34 views

logrotate not working as expected with my custom log

I turned on mysql general log, and since it was growing pretty fast I thought of using logrotate daily, so I created the log yesterday at about 2pm and this is how the log looks like: -rw-rw---- 1 ...
-1
votes
1answer
59 views

Crontab not running a shell script but works with command line

My question is about running a simple shell script using crontab. Crontab is successfully running one command like : * * * * * echo "test" >> /home/user/Bureau/testcron But not the other for ...