Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates.

learn more… | top users | synonyms (2)

0
votes
2answers
13 views

Crontab, keep output log, but disable email sending

For now I have crons like : 45 * * * * www-data php /var/www/console cmd:dispatch --env=prod 2>&1 > /var/log/cron/cmd_dispatch.log And I'd like to disable email sending. In order to ...
2
votes
3answers
3k views

How to check if my cron jobs are executed?

I hope I am asking this question correctly. I am trying to run all jobs that are setup on my server, by nano /etc/crontab I see the list of: # m h dom mon dow user command 27 * * * * root cd ...
0
votes
4answers
37 views

Is it possible for a cronjob to start before MySQL starts?

I am on CentOS 7, and if I put: * * * * * python script.py It works. If I put: @reboot python script.py Then it says it cannot connect to MySQL. If I run it from command line too, it works. ...
1
vote
0answers
24 views

Default umask for cron jobs [migrated]

How to set default umask for cron jobs, please? (On RHEL 6.) Jobs are started under non-interactive (obviously) no-login (?) shell. Not only I prefer dash over bash. But consider also bash called as ...
1
vote
0answers
6 views

Codeigniter logs: Database Driver Class Initialized 'a zillion times' [migrated]

We are currently trying to boost performance on some CRON jobs since they tend to throw a memory size exhausted error sometimes. In the logs we notice A LOT OF 'DEBUG - 2015-04-22 10:32:45 --> ...
1
vote
2answers
1k views

Capturing output from a remotely executed command via SSH fails in CRON

This question is in a direct relation to this one: ssh fails to execute remote command when run from cron bash script - works from CLI I'm not able to comment on the accepted answer as I don't have ...
0
votes
0answers
16 views

Replacing cron with another scheduling service? [closed]

We are looking to replace cron with some other scheduler that does entail code changes whenever we need to change a job, it will be used mostly for rostering services. The rational behind this is that ...
6
votes
2answers
1k views

Is CRON secure?

I want to install cron on my live web server to run a daily backup script of a local folder. Are there any security considerations I need to be aware of when installing cron? My web server uses ...
0
votes
1answer
41 views

why is PATH wrong with cron entry

I have an entry in cron.d: 31 17 * * * root /home/some_user/.bash_profile; /home/some_user/bin/some_script The profile sets a specific path, and I echo the current path in the profile to ensure its ...
0
votes
1answer
31 views

Crontab is delayed by 2 hours [duplicate]

I have got a problem with two crontabs that execute some operations on my website: the first one run a command every 3 minutes and the second one at 5am in this way: m h dom mon dow command 0 ...
17
votes
5answers
15k views

How can I monitor what logrotate is doing?

How can I monitor what logrotate is doing in Ubuntu? Can the activity of logrotate be monitored?
2
votes
2answers
1k views

Setting 'From' header for cron email using msmtp

I've got msmtp setup on Ubuntu 10.10 so that cron can send me emails. That works like a champ, for the most part. However, emails coming to my gmail account show up as coming from (unknown sender), ...
2
votes
1answer
1k views

Logrotate doesn't work from cron on CentOS

I have lograotate configured on CentOS 6. It works fine when I run it manually, but with CRON it doesn't work. Cron says in its logs: "All fine, I run you command" but nothing happens. Details: cat ...
5
votes
8answers
11k views

Difference between using crontab and /etc/cron.hourly,daily,weekly

I have a scheduled script that does an hourly svnsync backup of our Subversion repositories. I was running it from an entry in the root crontab without problems, but decided I'd like to run it from ...
1
vote
2answers
2k views

When cron is completed How to get email notification and log in a file (both)

I am a Newbie to linux. I'm trying to figure out things. Can someone kindly help me how to combine these two commands? (1) Normally cron can results can be directed to a log file by editing crontab ...
3
votes
1answer
91 views

Daemon to manage maintenance scripts

I have a bunch of "night shift scripts" to maintain a server. The problem is, the "action window", when those scripts may run is always different. Sometimes there's nothing going on for minutes and ...
4
votes
5answers
4k views

Where is this cron job running from?

Some time ago, I set up a cron job to run a script every minute. Since then, I've upgraded the system from ubuntu intrepid to ubuntu karmic. Now the job is failing. I get email about it once a minute. ...
0
votes
0answers
45 views

Inside Docker container - crond running but no cronjobs executed

I have built a container from a Dockerfile, based on an Archlinux base image. Using a "RUN" command I have installed "cronie", since Arch does not come with any form of cron. Now, after the container ...
1
vote
3answers
33 views

Monitoring file for changes and immediately take action on change

How can I constantly monitor (small) file for changes? Eg. when file is updated (action from web application), a script is executed (if not already running). Right now, I do it every minute using ...
0
votes
2answers
45 views

Cron job ignores part of trigger url

I created a cron job to trigger a url at set times, which in turn starts a product import script. But for some reason part of the trigger url with parameters is stripped away. I set the cron job like ...
10
votes
4answers
42k views

How to save and exit crontab -e?

How to save and exit crontab -e? i tried every method listed here and none works, i have a centos 5, vi comes by default with yum and i installed nano Solved just changed the default editor export ...
-5
votes
3answers
62 views

Crontab is not working [closed]

I am trying to add a new script to crontab using putty. I am following these steps: open putty enter my username / password enter command crontab -e to create new crontab copying this command to ...
1
vote
0answers
22 views

cron job sporadically not running

I have a CentOS 6.6 server with the following packages installed: crontabs-1.10-33.el6.noarch cronie-1.4.4-12.el6.x86_64 cronie-anacron-1.4.4-12.el6.x86_64 kernel-2.6.32-504.3.3.el6.x86_64 ...
-1
votes
0answers
10 views

How to cronjob a .sh file which contains shell script for copying files form one server to another [duplicate]

I have tried to set the cron with root access as well as without root access. I am rather new to shell script and cannot make to execute the cron for executing a .sh file. Please help guys.
0
votes
0answers
40 views

Cron not running at specified time

I have a new Centos 7 system and having a trouble with cron jobs not runnning at the specified time: [root@media cron.d]# cat /etc/cron.d/rsnapshot 30 02 * * * root /bin/rsnapshot daily 00 02 * ...
-1
votes
1answer
49 views

Run cron in centOS as user process, not daemon

According to this site, an easy way to set up a scheduled task in a single Docker container is to create a single crontab that runs your task, and then invoke it as the last Docker CMD with the line ...
-2
votes
2answers
40 views

What shell is used by cron?

cron runs shell commands from crontabs. But having just got caught out by the differences between zsh and bash, I'm now concerned that I don't know which shell cron uses to interpret crontab ...
0
votes
1answer
72 views

Timezone issue with cron inside a Debian Docker container

Here is my Dockerfile (or at least the interesting part): FROM debian:7 MAINTAINER pjb <pjb@example.com> RUN apt-get update && apt-get install -y build-essential ntp cron ADD ...
0
votes
2answers
72 views

mysqldump connects as different user from cron and from command line

I had a bug in a backup script running as a cron job which I found and corrected, but I'm still puzzled by the fact that this bug did not show up when the script was started from the command line. The ...
0
votes
1answer
116 views

openshift, cron, node, line 1: syntax error near unexpected token `('

I'm pretty sure this is some kind of config problem, or something like that. I'm using node V 0.10 and the cron cartridge V 1.4. Here's my bash script to run my node script: #!/bin/bash node ...
1
vote
1answer
42 views

Cron errors routing to external mail server instead of local

For some reason some usernames on a Solaris 10 system that have cron jobs send the cron errors to an external mail server to be routed back to the generating server which is blocked because of ...
1
vote
1answer
251 views

Reliably running background operations

I'm looking for a recommendation on how to reliably run background operations. I have many servers posting operation messages to AWS SQS, and I have another server which will run these CPU intensive ...
0
votes
7answers
992 views

vi syntax to comment out non-commented lines (cron)

Anyone know if it's possible in vi to replace only uncommented/non-blank lines with comments? If I want to replace a commented line with something I know I can use :%s/^#/##foo##/g -- but I am ...
1
vote
3answers
424 views

How can I change the default crontab editor

Can I change the default crontab editor to vi editor? If so, how?
0
votes
1answer
51 views

“NTP socket is in use” messages from ntpdate in syslog

In cron.log I can see that ntpdate is being triggered from a cron job which is running daily at 23:15 Mar 10 23:15:01 seitan /USR/SBIN/CRON[22407]: (root) CMD (/etc/network/if-up.d/ntpdate) But ...
0
votes
0answers
93 views

php curl does not execute url

Im writing a php cron script that needs to run a url After some database modifications the php script needs to execute an url $url = ...
0
votes
1answer
141 views

Errors when running cron: grandchild #10010 failed with exit status 2: 1 Time(s)

In recent weeks I have seen this type of error many times on my debian 6 servers. I have seen different exit status, 1, 2, 25, 255 Errors when running cron: grandchild #10010 failed with exit ...
0
votes
2answers
2k views

ISPconfig and running cron jobs as root [closed]

IPSConfig runs cron jobs as root. And when adding new cron jobs in ISPconfig it sets them to also be run as root and I don't see any way to change it. Is this safe?
0
votes
3answers
56 views

Load users environment variables in a cronjob

How can I load the users environment variables in a cronjob? I have a cronjob which should start a script every minute on my Ubuntu machine: * * * * * /home/user/myscript.sh; In this script I ...
0
votes
2answers
409 views

difference between /usr/bin/php and php in crontab

What is the difference between specifying "/usr/bin/php" and just using "php" when setting up a PHP script to run in my crontab? I would tend to just use "php" rather than the full path. 30 16 * * * ...
0
votes
1answer
4k views

Cron for a user not working in Plesk 10/11 [closed]

I'm having a strange problem with plesk and I can't seem to find an answer anywhere on the official support, so I hope somebody here can shed some light. I'm simply trying to run a script via cron ...
-1
votes
2answers
26 views

Symlink in crontab, script not found [duplicate]

I'm running Debian testing and can't get a simple cron to run a symlinked PHP script. I've a php script in a subdirectory in my home folder /home/foobar/dir/script.php (which starts with the ...
0
votes
1answer
21 views

Debian: environment variable not available for script running from cron?

I have this line: echo $(date '+%Y %b %d %H:%m') Your output $HOSTNAME When I do it manually from command line I can see my $HOSTNAME just fine. However, when it's running from a script that's run ...
0
votes
1answer
67 views

Why is cron using a different Ruby than my user and how to fix it?

I have a cron job that is a Ruby script. The problem is that the ruby executable is different than expected. Ruby was installed from source so it should be the new global default. $ ssh ...
2
votes
2answers
255 views

Why doesn't this command work as a cronjob, while it works perfectly when typed in a shell? [closed]

If I run this command from the shell, it works as expected: cd ~ && mysqldump --databases --skip-dump-date --host=localhost --user=admin --password=xxxxx --lock-all-tables ...
-2
votes
1answer
41 views

Impossible to add a script to cron [closed]

I am trying to add a script to cron jobs to be played daily. I tried multiple things but no one seems to work. First I tried to add a script in cron.daily: It s not triggered. #!/bin/sh cd ~/foo/ ...
0
votes
1answer
41 views

cronjob executing mysql and get root access denied

cron job file: 46 13 * * * root /home/tmp/test_mysql.sh script: execute_query(){ query="$1" res=`mysql --skip-column-names -e "$query"` echo "$res" } res=`execute_query "show ...
4
votes
4answers
2k views

Cron to run every 2nd wednesday?

I need to find a way to cron a job so that it runs every second wednesday of the month. Is this possible?
0
votes
0answers
53 views

crontab at reboot for EC2 instance

I'm trying to mount an EBS volume after restart. It does not work. I set the mount after reboot, in the following manner: echo "@reboot 'sudo mount $DEVICE_PATH $TARGET_PATH -O noatime,noexec'" | ...
-1
votes
1answer
2k views

Scheduled Task issue - /usr/bin/php/: No such file or directory [closed]

Can't get it working, I want to set up a cron job for a domain user in plesk 11.5, but seems that there's a problem to find the php executable. The command is: /usr/bin/php/ -f ...