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

learn more… | top users | synonyms (1)

1
vote
1answer
99 views

Skip syslog/rsyslog logging of certain cron jobs

In most GNU/Linux distributions the default is to log start (and many different events) of every cron job to syslog. It's rather convenient, but not for a very frequent jobs, which started, say, every ...
2
votes
2answers
68 views

CRON Job To Execute Command On Low Memory

I have a situation where I may need to execute an SAP command line tool hdbsql when memory gets too low (to help clean out the HANA table cache). I'm not well versed in Unix/Linux, and was wondering ...
2
votes
1answer
177 views

Task not run by crontab

crontab strangely does not execute my script, although the script is running just fine from the shell terminal. I already made sure that scripts are separated from each other by a new line space. ...
0
votes
1answer
72 views

Running a ruby cron job

I was trying to create a cron job which runs a ruby code on digital ocean, however it seems I'm making a mistake. It doesn't give any error but it doesn't also do anything. I ran this cronjob on my ...
3
votes
3answers
89 views

Only allow process to run between hours x and y

I use a mobile data connection service. I only have unrestricted bandwidth between 9am and 4pm. I wonder how I can "silence" applications such as the Dropbox applet outside that schedule. I thought ...
0
votes
3answers
69 views

how to tell crontab to execute the command from now instantly

I have a command in "/etc/crontab" which runs a database program every 7 days. Now, I see that this command has been commented by another user for 2 weeks. I immediately uncommented the line, and ...
7
votes
4answers
19k views

Cron running job every 15 seconds

Could you advise me what to write in crontab so that it runs some job (for testing I will use /usr/bin/chromium-browser) every 15 seconds?
0
votes
1answer
33 views

Checking the schedule of a cronjob and doing a conditional check on specific parts

Edit: I managed to solve this myself, I actually deleted my original question as I was over complicating the process slightly, but have since answered it in case others find it useful. RegExp is not ...
1
vote
2answers
695 views

Run A Cron Job Task Every 30 Seconds [duplicate]

It's possible to set the cron job tool in my website cpanel 'VPS Hosting' to execute php file every 30 second I am using it to execute php file once at a minute *,*,*,*,* but I need to set it to run ...
0
votes
1answer
63 views

help with remote file find/scp

I have a set of files on a remote sftp which I need to download to a server every day. sftp uses ssh keys to authenticate, so I created a ssh key and added to the remote server authorized folder. I'm ...
1
vote
4answers
118 views

How to stop minute cron job?

I have a program written in python; my program scrapes a value from some financial website every minute and pushes that value into my DB. My program takes like 1 or maximum 1.5 seconds to do this ...
0
votes
1answer
87 views

Cron Job every 55 minutes [duplicate]

I want cron to be run in every 55 mins. I followed the link CronJob every 25 minutes and my crontab command is */5 * * * * [ $(( $(date +%s) / 60 % 55 )) -eq 0 ] && wget ...
1
vote
1answer
101 views

Issue Using Crontab to Create/Restart Screen and Run Command

I want to have a certain script (rails rake task) running on my server at all times - it basically populates my DB using a live feed. I can create a screen (http://linux.die.net/man/1/screen) and run ...
0
votes
3answers
112 views

Cron job to run every minute from 11PM to 6AM

I have a python program which I need to run every minute from 11PM (EDT) to 06AM (EDT). How can I schedule a cron job to do this? * 23-6 * * 1-5 python my_program.py will this work? or do I have to ...
-1
votes
1answer
87 views

how to prevent cron job email splitting into multiple lines

CRON has emailed me the extract below : May 12 04:27:54 rpi postfix/smtpd[9343]: NOQUEUE: reject: RCPT from unknown[95.211.213.214]: 504 5.5.2 <WIN-HBAL58UG0JH>: Helo command rejected: need ...
1
vote
1answer
95 views

How to do version-control repository update in crontab?

I'm trying to automate version-control repository update in crontab. The following script /home/usr/mrbean/bin/update.sh works in interactive Bash command-line: #!/bin/bash ...
6
votes
1answer
72 views

How can I make `sudo crontab -e` use my `sudoedit` environment?

I've started using sudoedit <file> instead of sudo vim <file>. One of the advantages is that it uses my local ~/.vimrc. However, when using sudo crontab -e, it uses /root/.vimrc instead. ...
3
votes
3answers
4k views

Cron job to check if PHP script is running, if not then run

I am wondering if someone might point me in the right direction. I've got little experience working with the Linux command line and recently due to various factors in work I've been required to gain ...
0
votes
2answers
106 views

Cron job which runs every 5 seconds

I need to create an cron job with the following functionality: The job should go to a particular directory and touch one file every 5 seconds. It should run for only 1 minute. The logic is to ...
2
votes
1answer
44 views

Does systemd timer unit skip the next run if the process hasn't finished yet?

I want to use systemd to run a command every 5 minutes. However, there is a risk that occasionally the task may take longer than 5 minutes to run. At that point, will systemd start a second instance ...
0
votes
1answer
38 views

A generic cron wrapper that records all output

I am hoping to write a cron wrapper that records all output in a folder $CRON_LOG_DIR. It would be used as, e.g., follows: * * * * * $CRON_WRAPPER "<job name>" "command" which would record ...
1
vote
3answers
49 views

Cron job working, but crontab -l says no jobs

I am running raspbian on a pi and installed cron to schedule a job. I wrote a python script and I set it to run every 5 minutes. The job is happening every 5 minutes, no problems, but when I run ...
4
votes
1answer
83 views

high precision subsecond cronjob replacement

I am looking for a cron replacement which could run subsecond schedule, is there have any "still alive" project which serve this purpose? Currently running Ubuntu 14
0
votes
2answers
64 views

problem with cron job for every 2 minutes

I have a cron job for very 2 min and somebody told me that some servers do not allow 2 min cron jobs. basically from 30 min. it is true?
0
votes
2answers
5k views

What causes cron to continuously send mail and how can I disable it?

I have a problem on CentOS 6.3 system where the crond process tries to unsuccessfully send mail over and over (at least I think this is what its doing) until the OS eventually generates a "too many ...
11
votes
1answer
1k views

Suppress output unless non-zero exit code

What's the best way to suppress output (stdout and stderr) unless the program exits with a non-zero code? I'm thinking: quiet_success() { file=$(mktemp) if ! ( "$@" > "$file" 2>&1 ); ...
4
votes
2answers
261 views

Upgrading packages automatically

I'm fairly new to using servers (debian 7) and I'm currently running cron-apt to e-mail me when there are new upgrades available. Is the following command safe to run when new upgrades are shown? ...
12
votes
1answer
5k views

What's the meaning of the slash in crontab?

I have seen a crontab record in system. 0-55/5 * * * * root <command> I read the crontab -e example files and I know the first position stands for minute. But I cannot figure out the ...
2
votes
0answers
89 views
0
votes
1answer
72 views

Usage of '%' in the crontab [duplicate]

I am trying to add a cron job to perform an rsync from a remote server to a (Ubuntu12) local machine & create a log file. Below is the crontab-l 00 18 * * * rsync -a -v --delete -e ssh ...
0
votes
1answer
51 views

Crontab giving no result

I have set up a cronjob on my server which is supposed to run every minute and store the output in the given file. I have been trying a lot and saw a lot of links but nothing seems to work. Following ...
2
votes
2answers
43 views

how to get the run results of the cron job

I wrote a simple Hello World Java Program and created a jar file of it. Now to test the cron job, wrote a crontab.txt file with the line 50 12 27 4 1 java -jar HelloWorld.jar and saved it. At the ...
0
votes
1answer
51 views

Incrontab / Incron on Cygwin

Does anyone please know if it is possible to install incron/incrontab within Cygwin? I've had a look and the package does not appear on the cygwin website, I wondered if anyone had tried, knew of any ...
2
votes
1answer
97 views

Script not run with cron [closed]

i have a python script when i launch my script all it's ok but when i lauchn my scrypt under crontab i have this errors: .. 2015-04-24 14:36:02,163 ERROR Problème dans le module ...
2
votes
0answers
31 views

How do I process new additions to logs

I know that I can use a few tools like tail and less to view the newest additions to a growing log file. What I want to do, though, is run some sort of script at regular intervals (like cron) on the ...
2
votes
2answers
45 views

Cron job is writing the error to error log but fails to write outputs to output log file

I have 2 python codes which i schedule using cron. My codes actually runs from 10:30am to 4:20pm everyday. from 10:30am to 11:00am my codes outputs 2-3 lines every minute and after that they start ...
3
votes
1answer
58 views

What could be happening between pidof and kill to cause “no such process”?

I've inherited quite a bit of code and am looking at a cron job that restarts a service once an hour, no other scripts touch this process and this code is ran. #The name of the process has been ...
0
votes
0answers
85 views

Schedule backup with notification?

To avoid editing files at the same time of backup scheduled by cron, I figure out a way: Before backup, send a desktop notification such as notify-send -t 0 "Ready for backup", to let me prepare ...
2
votes
1answer
316 views

Default umask for cron jobs

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 ...
2
votes
1answer
95 views

Why cron jobs' output keeps getting written to ~/dead.letter?

I have a job scheduled by cron running every day, and the job is about compressing a folder using tar; and I found that the standard output of tar keeps getting written into ~/dead.letter everyday. ...
-1
votes
3answers
109 views

My cron job doesn't run

I set up to run notify-send every minute, $ crontab -l 1 * * * * /usr/bin/notify-send -t 0 "hello" Why does it not work? Do I need to restart OS after editing the crontab file? Does the following ...
0
votes
0answers
42 views

editing files at the same time when cron automatically runs backup

I heard that it is a good idea to schedule backup in crontab file. I also head that it is bad to edit files while they are backed up. It may happen that cron stats to backup a directory while I am ...
0
votes
1answer
76 views

Does a job scheduled in crontab run even when I log out?

I add some job in crontab file on a server. When I log out and the server is still on, will the job still run? Does it matter if I create a screen or tmux session and run some shell in it and ...
2
votes
3answers
503 views

Shall I save my crontab file in /tmp?

I ssh to a server, and want to add some daily jobs (specifially to renew Kerberos tickets even when I log out and I still want my programs in screen or tmux continue to run) to cron. So I run crontab ...
1
vote
1answer
76 views

delete redis keys that have been inactive for 30 days

I've installed a web app called scrumblr which uses redis as a database. What I am attempting to do is delete all keys that have been inactive for 30 days, or have not been accessed in 30 days. I ...
0
votes
1answer
175 views

Whats the best way to clear / empty Apache log files periodically

I am running Apache server on lubuntu linux, Since there are plenty of applications ruining on the web server with 10+ users accessing the server regularly, the server logs [access & error logs] ...
2
votes
2answers
252 views

Is it possible to schedule a cron job to run fortnightly?

Is there a way to schedule a cron job to run every fortnight? (One way I can think of, within crontab, would be to add two entries for "date-of-month"...)
2
votes
1answer
156 views

Cron job not running after giving command in crontab

I am trying to run a cron job in Linux with following command: crontab -e typing the following details and saving it MAILTO="mail@domain.com" 00 01 * * * /usr/local/bin/php /var/www/html/cron.php ...
1
vote
2answers
76 views

Do I need to keep an SSH session alive for cron to run?

I know about nohup. It prevents processes from dying after a hang-up. What I want is my user crontabs to run even if my session has timed out when they are supposed to run. I believe I need the user ...
1
vote
2answers
670 views

how to automatically cleanup failed PHP uploads in /tmp?

How can I automatically cleanup failed uploads? PHP is storing them in /tmp and all file names look like phpAbCDeF (basically php followed by 6 characters). I know that I can use the command: find ...