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

learn more… | top users | synonyms (1)

52
votes
3answers
188k 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
39 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
49 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 ...
43
votes
10answers
83k 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
31 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
214 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
26 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
51 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 ...
1
vote
2answers
6k views

how do I run a cron job with a specific user?

My cron and scripting skills are very poor, but I need to run a job every 5 minutes by user 'cpc'. So I created a script and left it at /root. My crontab -e entry about it is: 0-59/5 * * * * /root/...
0
votes
2answers
65 views

Why is this commented out crontab file line executed?

To my surprise a trial of using crontab and rsync for backups of some test files, that I started last December (2015), is still running although, in the only crontab file I have, the only line is #...
5
votes
3answers
1k views

command not running in cron (systemctl suspend)

I have this cronjob set : * * * * * /usr/bin/systemctl suspend And it is not working. But I can run it in a shell and it works. I don't understand what could be not working. EDIT Redirecting error ...
1
vote
1answer
51 views

notify-send from root cron

On my system, notify-send requires 3 enviorment variables to run, which are kept in a file which is generated automatically on logon: /home/anmol/.env_vars: DBUS_SESSION_BUS_ADDRESS=unix:abstract=/...
0
votes
4answers
884 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 ...
0
votes
0answers
23 views

Godaddy Cron timezone change

There is a discussion http://stackoverflow.com/questions/13289751/cron-job-in-a-different-timezone/37764183#37764183 Could anybody clarify answer of @Bartosz Kowalczyk http://stackoverflow.com/a/...
1
vote
1answer
529 views

Crontab permission problem

I have a fc19 host at work. This morning crontab did not work. $ ls -l /usr/bin/crontab ----------. 1 root root 53472 Jun 11 2013 /usr/bin/crontab The permissions -------- means no one has access ...
2
votes
0answers
172 views

Configure job to expire

I'm learning Linux at the moment and were doing some exercises scheduling jobs with cron and crontab, but I'm wondering if it's possible to limit the amount of times that the scheduled job is ran. ...
1
vote
1answer
20 views

Rolling job scheduler

I have a number of servers that I want to perform the same jobs on, one server per day, once the final server has been acted upon the script should return to server1 and start over again. The jobs ...
4
votes
1answer
109 views

How do I schedule a cron task to run

I'm looking to crontab a script every hour starting Friday at 5pm... ending Monday at 5am. This script checks if it's completed this week and if it's currently running. If no/no, start task. Off the ...
0
votes
1answer
32 views

Use of Verbose in a cron job

I'm busy setting up a back-up script to run on my Pi using rsync. I see that a number of people use the -v option in their cron jobs. Why? It's going to be run as root, and not in a terminal where ...
14
votes
2answers
3k views

Origin of the word cron?

Trying to settle a friendly argument. Is "cron" an acronym for something? Additionally, did it's current canonical name "cron" originate from something shortened for something like chronos or ...
0
votes
2answers
912 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 ...
0
votes
1answer
31 views

How can I set the MAILTO variable for an at job on AIX? [closed]

I'm calling at jobs on AIX servers using this method: /usr/bin/at now +1 minute << EOF chmod 700 /var/tmp/somescript.sh cd /var/tmp sh /var/tmp/somescript.sh > 2>&1 EOF If ever some ...
1
vote
1answer
36 views

Using 606 file permissions in /etc/cron.d. (root) BAD FILE MODE)

I have a file in /etc/cron.d with 606 permissions to be run by root. The intention is to provide read & write access to 'others' via 606 to allow a script to modify the file. Cron does not ...
1
vote
1answer
39 views

sh script containing perl element does not produce same output via crontab as manual execution

I tried posting this on Stackexchange but I think I may have more chance of a correct answer here as its very linux specific. I have an sh script which updates data in a csv, then runs a perl script (...
1
vote
4answers
57 views

How do I delete file by filename that are set as dates?

I want to delete file not by date access or created, but by filename. The filenames will be dates and I want to have a cronjob run once a week that will purge filename dates older than 7 days. I could ...
0
votes
0answers
529 views

How to stop mail with PHP error messages to root?

Today, my Centos has a problem. When I type df -h in SSH I get: /dev/vzfs 61G 61G 0.3G 99% / The disk is full. I found that /var/spool/mail/root is nearly 53GB. tail /var/spool/mail/root -n 50 ...
0
votes
0answers
15 views

Settings of Poller Interval and Cron Interval on cacti

Latest version running of Cacti on linux machine and I am bit confused with Poller Type, Poller Interval and Cron Interval. The current setup is set to monitor ping latency, linux machine and dns ...
1
vote
2answers
37 views

Automatic backup and exclude of certain folders

I have created the follow bash script to be used in Cron for automatically backing up certain folders,...while also excluding certain sub folders: folders_to_backup=( "/fist/folder/to/backup/" ...
1
vote
2answers
25 views

@reboot jobs don't work

I have been trying to make my fedora pc do a little script at reboot but i can't get it to work. My script works perfectly, for example if it's 02:10 and inside crontab -e I write 11 02 * * * /path/to/...
1
vote
1answer
36 views

why the executing shell within cron job will take longer time than normal? [duplicate]

I have a shell script which will run project consist of multiple JUnit tests. Then I call this shell within cron job every a period of time. In this case, I observe the following: Time to complete ...
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
2answers
29 views

crontab each 12 hour - when will it send an email?

I am installing new crontab job which will execute a shell script and then send the printed errors on the console to email. I know all of the required steps to do, which will be as following: 0 10,...
0
votes
2answers
55 views

How to run multiple scripts at a same time?

Suppose I want to run five different scripts at 3 PM on every Saturday and I want to put all these scripts in a single script and run it using cron.
1
vote
1answer
23 views

when the cron job start after installing new crontab?

I need to a crontab execute each 12 hours, so I have the following: 0 */12 * * * . /X.sh then Linux is installing new crontab. after that, I am waiting for 2 hours and still the cron job didn't ...
1
vote
1answer
48 views

How to schedule run shell script that opens Firefox [duplicate]

I have the shell script which opens Firefox and launches macros in it (I use a Firefox add-on called Imacros to create macros). The content of my shell script named house.sh is like that: firefox ...
0
votes
2answers
1k views

Pushing to a Git repo from shell script

I'm trying to commit/push changes to a remote Git server with the below sample code: #!/bin/sh USER='username' REPO='/home/'${USER}'/Sites/git/bitbucket/kb' COMMIT_TIMESTAMP=`date +'%Y-%m-%d %H:%M:%...
1
vote
1answer
40 views

Running a cron job randomly for every one hour

I want a cronjob to run every one hour randomly. (i.e if the first job runs at 58 minutes,the second job should run at 47 minutes and the third one at 52 minutes and so on) But this should run ...
1
vote
1answer
30 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
22 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
19 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
34 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 time-...
3
votes
2answers
944 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 ...