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)

-1
votes
1answer
17 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 ...
-1
votes
2answers
36 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 ...
-1
votes
1answer
35 views

ubuntu script two different outputs [duplicate]

So I have a script that checks with curl if a website is redirect. If the website is redirected, an e-mail will be sent. If the website is not redirected, an if-statement is called where I get the ...
0
votes
1answer
21 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
0answers
14 views

How to move a cron to a subdomain [closed]

Im trying to set up cloudflare on my website but they don't support cronjobs they recommends moving cron to a subdomain and/or that you create a new subdomain that they don't proxy. I know how to set ...
0
votes
1answer
38 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 ...
0
votes
2answers
57 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 ...
-4
votes
0answers
21 views

Daily cron errors

Last time I receive on e-mail cron errors like this one: PHP Notice: Undefined property: stdClass::$response; File: /usr/local/psa/admin/plib/modules/servershield/scripts/aggregate-stats.php, Line: ...
1
vote
1answer
34 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 ...
0
votes
1answer
39 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 ...
-1
votes
0answers
21 views

How to set a cron for csf restart [duplicate]

I am trying to set a cronjob for the linux firewall csf. ( The reason is I need to make sure lfd is running, as it sometimes stops operating, for whatever reason, and yes, I am checking to see what ...
0
votes
0answers
41 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
0answers
7 views

'nc' using ~100% CPU when transferring a FIFO file [migrated]

On the server which is always connected I’m using this in a crontab: @reboot nc -k -l 1234 < /tmp/fifo.fifo On the client which is not always on the network or switched on I’m using this ...
0
votes
3answers
50 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
1answer
80 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 ...
-1
votes
2answers
19 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
17 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 ...
-2
votes
1answer
40 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
37 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 ...
0
votes
0answers
42 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'" | ...
3
votes
3answers
539 views

Why cd does not change current directory in crontab?

In my user's crontab, on a CentOS system, I have something like this: 58 12 * * * cd /home/joe/dev; echo `pwd` | logger This outputs in /var/log/messages: Feb 19 12:58:01 srv01 joe: /home/joe ...
-1
votes
1answer
40 views

crontab grep function execution [duplicate]

When I tried exection grep function in particular directory its working on that directory but when I am trying to execute using absolute paths grep is not working for example grep `date +%Y-%m-%d` ...
0
votes
1answer
30 views

CSF not adding IPs to deny file as a cron during high loads

I'm running a cron every minute to thwart brute-force attacks. awk '{print $2}' < ipkill.txt | while read ip; do #query geographical info IP address curl -o country.txt ipinfo.io/$ip ...
1
vote
3answers
248 views

Using nice scheduling priority with tar/gzip cron script

I do large backups that put huge strains on my server when using tar/gzip. I've got the task setup as a cronjob which accesses my script that handles the backup. I know that nice might be able to ...
0
votes
2answers
42 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 in ...
0
votes
2answers
74 views

/etc/crontab file not executed

I created a dummy entry in /etc/crontab, but it doesn't get executed according to cron log /var/log/cron: Feb 7 08:20:01 localhost CROND[22781]: (root) CMD (/usr/lib64/sa/sa1 1 1) Feb 7 08:30:01 ...
-1
votes
1answer
126 views

Cron job is not working in centos 6.6

I have dedicated server having centos 6.6 and centos webpanel. Now I'm trying to set cron job from centos web panel. I had tried so many commands to run one php file each and every minute, but still ...
3
votes
1answer
60 views

Cron job as root need to sudo to another user [duplicate]

RHEL6 In root's crontab a have: * 21 * * * /root/script.sh In script.sh there is a line: /usr/bin/sudo -u jira bash -c 'cd /opt/jira/bin; ./stop-jira.sh' && echo "Jira Shut Down" >> ...
6
votes
1answer
972 views

amavis cronjob throwing an error out of nowhere

Can someone explain why amavis cronjob is suddenly trowing the following error? Cron <amavis@bee> test -e /usr/sbin/amavisd-new-cronjob && /usr/sbin/amavisd-new-cronjob sa-sync rules: ...
0
votes
0answers
25 views

why is cron flooding wtmp and last?

When I type the last command, I see a bunch of entries in there for cron. Every single cron job that gets run creates an entry and it's flooding wtmp with unnecessary entries. Any ideas how I can stop ...
0
votes
1answer
31 views

How to use .profile alias in crontab [duplicate]

I've read the answers to this question, but still don't understand what to do: How to use my aliases in my crontab? I am logged onto my Ubuntu server as root. I have the following command in my ...
0
votes
0answers
29 views

Using placeholders or environment variables in sudoers

Is it possible to use in sudoers rules any kind of placeholders (not just wildcards) or environment variables? What I would like to do is to verify that user (the one sudoing a command) passes as an ...
0
votes
2answers
81 views

Crontab: Authentication token expired; new one is required

I have a crontab job running daily as a non-root user job. Unfortunately it did stop working with the following message (in /var/log/syslog): CRON[29256]: Authentication token is no longer valid; new ...
1
vote
1answer
50 views

Kill old php cron script

After running ps aux | grep php, I found about 10 php scripts ran by cron that have started over a week ago and are hanging. Each script usually take 40 seconds to complete. I have set ...
0
votes
2answers
43 views

Creating a log file inside a script works when manually run, but not when run through cron

I'm using Percona's Xtrabackup tools to back up a database nightly. I wrote a wrapper script to keep the proper number of backups around, write the output to a log file, and email the log file if the ...
0
votes
1answer
31 views

How to do SSH authentication and CVS update automatically from cron job?

I call a script from cron job. In the script it needs to run CVS commands to update from a remote repository. To do that, it needs to SSH authenticate. I put the following code in the script ... ...
0
votes
1answer
46 views

makewhatis and logrotate cron job schedule

In /etc/cron.daily/, logrotate* makewhatis.cron* I understand that above are daily cron jobs. How to display the time set for logrotate and makewhatis.cron? Its not listed when I tried this ...
0
votes
1answer
64 views

124 emails sent at once while one should be sent every five minutes by cron if a certain web service stops running

So I set up a simple script to send an email alert when a certain web service stops running. It has a simple flow of: test = $( curl [address] | grep [a certain string in response] | wc -l ) if [ ...
3
votes
1answer
212 views

How to schedule a Cron job for the second to the last day of each month

I want to schedule a task for the second to the last day of each month. I have read this great article about shell scripting the execution. I have also seen that you can use "L" to represent the last ...
0
votes
1answer
41 views

rsync: how will rsync react to a file copy from a mounted share to a remote location?

I have a task to create a passive sync between a production server and a staging server which are located in two different geographical locations. The environment is fully Linux based (CentOS/RHEL) ...
2
votes
1answer
39 views

Do cron and atd run jobs with the same user, permissions and environment?

What's the difference between running a bash script via cron and running the script via atd? Is there any difference? Is it specific to the distro? If so, what about SLES 11?
-1
votes
2answers
214 views

Start Tomcat through cronjob

To make sure that Tomcat is running all the time, I wrote the following shell script #!/bin/bash status="$(curl -s http://www.domain.com/check)" if [ "$status" != "OK" ] then ...
0
votes
1answer
58 views

How can I tell a script is running under cron?

Is there a standard way to know if a shell script is running under cron as opposed to running from the command line. i.e. I'm thinking of running with more verbose output when manually kicked from the ...
0
votes
2answers
45 views

Do i need to restart after editing anacrontab?

To help trouble shoot a few servers, I have edited the delay time in anacrontab. Do I need to restart anything for these changes to be applied? Thanks
1
vote
2answers
60 views

cronjob not running daily

I am a linux newbie. With that said I need a cronjob to compress some syslog files after 48 hours to keep the size manageable. These files are currently located in /syslog - a disk I added to handle ...
-4
votes
1answer
105 views

Crontab - I have two cron jobs but only one works [closed]

I use ubuntu 14.04 LTS. I have created 2 cron jobs but only one works. The 2 different website building with drupal cms. */5 * * * * curl -s ...
1
vote
1answer
50 views

WP-CLI doesn't run from cronjob

I made a bash script that uses WP-CLI and was intended to run from a cronjob. It runs fine from SSH, but fails when run through cron. During debugging I discovered that it was the WP-CLI part that ...
0
votes
2answers
70 views

Odd Crontab Service SMB Restart Issue

System: Debian Wheezy x86_64 Service: Samaba So when i'm in a terminal i can use service samba restart or /etc/init.d/samba restart to restart the service. When I create a cronjob and do ...
0
votes
0answers
28 views

cron job time managment

I have cron job A and B (both jobs run every minute) from 9.00AM to 6.00PM I like to make the second one run after the first one in 30 second.both cron job should be run by root user. for example if ...
3
votes
1answer
192 views

Cron Daemon Wget blocked

I've got Nginx on Debian 7 without cpanel. I am seting-up my Crontab like this: */45 * * * * wget "http://example.com/cron-url.php" >/dev/null 2>&1 The above cron is being blocked with ...