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
0answers
15 views

What is the best way to run PHP script every 30 seconds? [duplicate]

I have kind of a special requirement that is, I'm using a Raspberry Pi 2 B device to feed some data to a mysql database in a cloud serve. So I have installed LAMP stack on raspberry pi and config my ...
-3
votes
0answers
11 views

Sending Syslog information via Cron to specific user mail [on hold]

I would like to know how to create a Cron that scans the database every 2 minutes when it found severity's field equal to "critical", "error" or warning, it will send me an e-mail. thanks.
3
votes
4answers
4k views

Synology cron job not working

I am not sure where to ask this question but I'll ask here first. I've got a Synology DS211 server and I am trying to run cron jobs but it is not working. This is the code I got in the crontab file ...
0
votes
0answers
15 views

Service for a reliable at-most-once script execution [on hold]

I have a task that I would like to reliably execute every 5 minutes, 24 hours a day. i.e. at exactly 12:00, 12:05, 12:10, 12:15, etc. I currently use bunnycron running on a cluster of 2 servers + 1 ...
-2
votes
1answer
23 views

VPS Cron and other email going to spam folder [duplicate]

I have a new vps and I need to setup some cron jobs on it to notify me of what's happening on the server. I've tested with sendmail and emails are indeed leaving the server, but on my email they are ...
23
votes
7answers
11k views

Can I run a cron job more frequently than every minute?

Is it possible to run a cron job every 30 seconds without a sleep command?
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 ...
-1
votes
2answers
533 views

Passing date/time to cron job command

Is there any possibility to pass current date/time to command in my cron job? E.g. I want to make sql dump every night and name the dump file like 'dump-yyyy-mm-dd.sql'.
-2
votes
0answers
24 views

Free Nas Cron Job not finishing [on hold]

I have a simple backup archival bash script that runs every night. I have 8-10 directories for our database servers with dump files of all the databases. The script in question is supposed to loop ...
0
votes
1answer
23 views

How to detect if a longer chain of commands in cron fails?

I want to create a crontab wrapper in python that logs if a crontab entry fails. It should be useable like this: 0 * * * * cronwrapper -c "some_command | some_other_command & third_command ...
1
vote
2answers
1k views

how to properly run a scrapy crawl from cron

How would I run a command like scrapy crawl empt.com in a cron job where I need to be in a specific folder to run the command for example: /downloads/my_crawler/empt/empt/ then the command scrapy ...
6
votes
1answer
155 views

cron job occasionally 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 ...
3
votes
3answers
32 views

Is it possible to determine if a job is being started as an at job (kicked off via atd/cron)?

Is there a way to identify a script is being run as an at job instead of interactively from the shell by a user? Some of our scripts have a guard to check if they're running in screen by checking ...
1
vote
3answers
42 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
715 views

Failover tmpfs mirroring. Am I doing it right?

My goal is to have a certain directory to be available as tmpfs. There will be some modifications during server uptime in this dir and those modifications must be synced to non-tmpfs persistent dir on ...
2
votes
3answers
268 views

cron job sending emails in a wrong charset

I have following command in a cronjob: */5 * * * * php /var/www/domain/yii rss/parse It outputs email in a wrong charset: Content-Type: text/plain; charset=ANSI_X3.4-1968 But when i launch that ...
0
votes
1answer
29 views

centos 6 64bit crond not running on startup?

I have two VPS from ramnode, centos 6 64bit. I have reinstalled server 2 several times and also tried 32 bit centos 6. Same problem. Whenever I type reboot and then service crond status it says ...
0
votes
1answer
92 views

How can I control a gradual file upload with cron or similar? [closed]

I have several terabytes of data I need to back up to S3/Glacier over a slow link. I want to upload from, say 9pm to 9am and resume from where it left off. Is there free software that would do that ...
2
votes
4answers
3k views

Running cron every 10 minutes

I have a python script on my desktop: /home/ceasor/Desktop/script.py In /etc/crontab, I wrote: 0 */2 * * * ceasor sudo python /home/ceasor/Desktop/script.py The python script is not ...
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), ...
1
vote
2answers
26 views

how to stop cron mail receiving in spam folder?

I have added a cron job for my incremental backup, and I configured it like this.But my mail goes to spam folder.so iclick not spam option in mail.it moves to inbox.but again it receives in spam 0 23 ...
0
votes
0answers
31 views

cron job doesn't run under specific account

I have a crontab entry on my RHEL 5.4 system under the "oracle" account but it never seems to actually run. I have the following entry: * * * * * /home/oracle/blahblah.sh > /tmp/test.log ...
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 ...
0
votes
1answer
26 views

Run cron jobs in different TZs

I have several cron events that need to run but on different timezones. For example, I have one event that runs every day at 08:30 UTC, and another event that runs every day at 09:30 CET. I've read ...
0
votes
3answers
105 views

How to send an e-mail after a cron job [duplicate]

I have added a cron job for my incremental backup, and I configured it like this: 0 23 * * * /usr/bin/rsync -ravzX /mnt/external/project/ /media/backup/project/ | mail -s "Backup Success" ...
19
votes
10answers
51k views

Running a cron job manually and immediately

(I have already read How can I test a new cron script ?.) I have a specific problem (cron job doesn't appear to run, or run properly), but the issue is general: I'd like to debug scripts that are ...
0
votes
1answer
21 views

Issues with Webalizer cron job throwing error due to file cannot open - how to Fix?

So I have a newly installed server running Ubuntu 14.04 with the default install of Sentora the free open source control panel. I did not make any customization to webalizer or cron. So I am unsure ...
1
vote
2answers
81 views

Privileged command as part of cronjob [duplicate]

I have a personal username/password on a unix machine with limited privileges. Whenever I need to execute some commands I have to substitute user using the su command, then I execute it normally. ...
2
votes
3answers
645 views

Running a script containing find with a regexp fails in cron but works in a shell

I have the following script in my /etc/cron.d: 19 15 * * * root /opt/scripts/clean-nexus-release-repo.sh The clean-nexus-release-repo.sh script looks like this: #!/bin/bash find ...
1
vote
1answer
244 views

Root cron job can't read file from /root/

I've got a cron job in root's crontab defined like this: 0 1 * * * /usr/local/bin/tarsnap-backup-script > /tmp/tarsnapcron.txt 2> /tmp/tarsnapcron.err The script is a python script that ...
61
votes
3answers
66k views

Why is my crontab not working, and how can I troubleshoot it?

This is a Canonical Question about using cron & crontab. The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below. This addresses the cron system with ...
1
vote
4answers
116 views

Adding task in crontab

I'm using a Linux Enironment (Ubuntu 9.something). I used the following command: crontab -u myusername /home/myusername/test_cron_file Works great. When I check the spool folder, everything is as ...
1
vote
1answer
196 views

Linux cron spamming me then stops about php/suhosin

My server emails me when any messages goes to root. cron sends me messages. Today I got over 300 emails from my server all of which are PHP Warning: PHP Startup: Unable to load dynamic library ...
0
votes
1answer
83 views

Add cronjob with bash script - No crontab for root [duplicate]

I have a deployment script and in it I'm trying to add a cron job. This is the code I am using which I found on stackoverflow. I'm running debian 8. # ADD CRON crontab -l > mycron echo "10 * * * * ...
0
votes
1answer
139 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 ...
0
votes
1answer
31 views

Disable cron jobs or cron daemon on Ubuntu 10.04 server in rescue mode

I am trying to recover an Ubuntu 10.04 server in rescue mode and I want to stop cron jobs and/or cron daemon running on reboot. So far I have: Edited the cron files in /var/spool/cron/ renamed ...
1
vote
1answer
52 views

Why is PATH wrong with cron entry? [duplicate]

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
2answers
21 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
43 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. ...
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
36 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 ...
18
votes
5answers
16k 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?
5
votes
8answers
10k 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
92 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
3k 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
2answers
50 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 ...
11
votes
4answers
43k 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
64 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 ...