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

learn more… | top users | synonyms (1)

1
vote
1answer
22 views

automate updates with a bash script and cron

I'm trying to automatize the updates of debian system, without making upgrades. Then i'll send an e-mail to me, everytime there is an upgrade available. I've tryied to do it with cron-apt, but i ...
5
votes
0answers
54 views

CRON Permission Denied

I have a Debian 7. 3 Server with WebMin installed. I configured a cron job to run every minute as root user, so I run the command crontab -l when I'm logged in as root it shows: * * * * * ...
-1
votes
1answer
16 views

cron not working with .bash_profile function name [on hold]

I do crontab command * * * * * source ~/.bash_profile; rsyncUbu4RedisFolder 2>&1 >> /tmp/cron55.out where rsyncUbu4RedisFolder is function in .bash_profile: rsyncUbu4RedisFolder() { ...
1
vote
4answers
1k views

Crontab not working

I'm trying execute a basic shutdown crontab to run M-F at 10PM. So I did the following: sudo crontab -e Once inside of the crontab I added the following line: 0 22 * * 1-5 shutdown now The job ...
2
votes
1answer
31 views

How could I signal to a cron job to skip runs?

I have a cron job that runs every X mins and that I would like to have a way to "signal" it not to do anything if needed. Is there a standard way for this? The only idea I had is to check some ...
3
votes
2answers
93 views

Does cron know that the instance to be scheduled is already running?

I was wondering if we add a job in the crontab e.g. to run every 5 mins and the job does not actually manage to finish in 5 mins, does the cron daemon know that the previous instance is already ...
26
votes
9answers
11k views

Correct locking in shell scripts?

Sometimes you have to make sure that only one instance of a shell script is running at the same time. For example a cron job which is executed via crond that does not provide locking on its own (e.g. ...
1
vote
2answers
382 views

Crontab not triggered

I have a program written in C with OpenCV. It captures an image from the webcam and saves on the disk with the name given as an argument. I want to trigger it every minute, thus I inserted the ...
0
votes
1answer
30 views

Getting a Bad Hour Error in crontab

I am getting Bad Hour error for below peice of code in crontab */05 17-05 * * * wget -q -O /dev/null "http://abcd/cron/abcd" Is there any issue with this. I want the cron to run from evening 5 PM ...
0
votes
1answer
25 views

Cron task starts at 5:30 and runs every 5 mins once

I want to run a crontab cron job which start at 5:30 AM and runs every 5 mins. How do i set it up in Linux? I am able to give like below. But how do i make it 5:30 ? */05 5-16 * * *
2
votes
1answer
30 views

Accidentally typed crontab with just the dash

What happens when I type just "crontab -"? The "e" didn't take before I hit Enter. It just moved the cursor to the next line and I had to Ctrl+C to exit, but I'm not sure what it did exactly. I'm on ...
2
votes
1answer
38 views

cronjob for automatic DB backup to date prefixed file

I am using the latest Linux Mint. I was wondering if it's possible to create a special cronjob for a database backup. In my /etc/cronjob file I have the following code: # Minute Hour Day of ...
0
votes
1answer
51 views

Can continually assigning a variable in a shell script cause a memory leak?

I've written a short script to copy Apache's server status to a log: #Save date and time to a variable dt=$(date) #Echo date and time to the log file as it's not included in server-status echo "Time ...
0
votes
1answer
19 views

Cron: Client does not have permissions to send as this sender

Platform: Arch Linux Cron: cronie Mail: msmtp I discovered that sending cron output to a mailbox hosted by Office 365 produced the following error, even though sending mail through the CLI was ...
1
vote
1answer
37 views

Cron task in graphic interface

I need to open one (or more) browser tab periodically and I decided to use cron. The command in the shell (bash) that correctly executes this task is chromium-browser http://mysite.com. If I type it, ...
0
votes
3answers
505 views

Custom crontab does not work (FreeBSD)

I created file crontab.custom with: */1 * * * * /home/username/data/www/run.sh And run.sh contains: php script.php After this I run this command crontab crontab.custom. Now crontab -l ...
0
votes
2answers
43 views

How can I ensure that a custom environment variable is set before cron runs a task?

I recently experienced a logwatch issue that is fixed by running export DATE_MANIP=DM5. cron seems to forget this when I logout (presumably because it's not saved). Where can I add this custom ...
5
votes
3answers
133 views

Is any extended logging available for cron jobs?

I have 3 scripts under /etc/cron.daily. My cron logs are written in /var/log/cron. The below is an entry for the above cron that has run. (root) CMD (run-parts /etc/cron.hourly) Here the stdout or ...
1
vote
2answers
356 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 ...
2
votes
1answer
48 views

cron midnight 00 24 or 00 00? [closed]

My current crontab looks like this: 00 00 * * 1-5 "/home/user/script.sh" But it seems like it is not being triggered, all others are triggering fine except the one running at midnight. What is the ...
3
votes
1answer
50 views

What's the easiest way to set up a 2-hour alarm?

I want my computer to play some given .mp3 every 2 hours. I want it to run at startup, and be modifiable with a given .conf file. The choice of .mp3 will also be in the .conf file. The reason is, I ...
3
votes
2answers
63 views

How to run a command as if it is called from cron

I write a script and set it as a cron job. But due to a difference of environment variables it doesn't work as it should be. In that case I change a little bit with crontab -e and set a cron job time ...
0
votes
1answer
27 views

Crontab in Daylight Savings

This weekend with daylight savings, we had a situation that when the system clock hit 3:00am from the jump, we had hundreds of processes fire off out of the crontab. Everything I'm reading says that ...
7
votes
1answer
181 views

Cronjob to Run and then Terminate

I want to add a cron entry that does something like: 00 00 * * * * /tmp/script.sh Is there something I can add to the end of the line, so that when it is finished, it will remove the line out of my ...
1
vote
1answer
53 views

Why does redirection in crontab result in a zero byte file?

System: Xubuntu 13.10 When I have this crontab entry */5 * * * * cat /home/dbk/.bash_aliases &> /home/dbk/Desktop/junk junk has a byte size of 0. Running $ cat /home/dbk/.bash_aliases ...
1
vote
1answer
178 views

security concern around adding cron user to web application group

I have a permissions issue on my CentOS 5.6 machine with regards to the cron user. On my test/staging environment my cron user (picco-cron) is a member of one group - picco-cron, as below: ...
7
votes
7answers
897 views

cron Vs. sleep - which is the better one in terms of efficient cpu/memory utilization?

The Case: I need to run some commands/script at certain intervals of time and for this I have two options - 1. set up a cron-job or, 2. implement a loop with sleep in the script itself. Question: ...
2
votes
1answer
7k views

Crontab job start +1 min after @reboot

Need a script executed at each reboot in +1 minute. I placed a record @reboot but it is too early for my script. How to execute it sometime after reboot?
0
votes
2answers
22 views

Cron Job - Log Each Minutes Activity [duplicate]

I have some cron jobs set up to run, some of them each minute. I know I can log them to text files by simply putting php /path/to/file.php > /var/logs/something.txt but can I do this every minute? ...
2
votes
1answer
320 views

How do I push a Mercurial repository to BitBucket over ssh?

I created a public key for ssh and registered that key with BitBucket. I then attempted to push: $ hg push ssh://jhayward@bitbucket.org/johncharrell/[project name] pushing to ...
1
vote
0answers
45 views

Trying to kill cron job processes found by “ps ax | grep keyword” logged in as pi user

I'm trying to kill several processes from the command line logged into the pi as the user pi. All of the processes have been started by cronjobs, so they should belong to the root user. I'm running ...
2
votes
0answers
24 views

Solaris cron ignoring mail aliases?

As a Solaris user, I want cron jobs generated emails for the localuser@server to be forwarded to my myuser@sample.com email account, so that I read only one inbox. To resolve this I have forwarded ...
1
vote
1answer
30 views

As root, how can I list the crontabs for all users?

I have a script being run automatically that I can't find in the crontab for the expected users, so I'd like to search all users' crontabs for it. Essentially I want to run a crontab -l for all ...
1
vote
2answers
176 views

How come crontab -e is different from less /etc/crontab?

Im pretty new to unix and crons, I was currently about to try to add crons to an existing cron file. I read you could do this with crontab -e. The confusing thing to me is just that crontab -e shows ...
1
vote
3answers
42 views

variables in crontab [duplicate]

On our linux server we have a lot of entries. Many entries look like this: 15 13 * * 3 /very/long/path/to/binary/run.sh ... These entries would be easier to maintain if I could write: 15 13 * * ...
1
vote
1answer
48 views

Help with “crontab -e” [duplicate]

I'm trying to learn a little about cron and would appreciate some help. I edited crontab -e to have this line: */10 * * * * /usr/bin/touch /home/dkb/Desktop/test.txt It works and I see ...
2
votes
3answers
110 views

Setting up a cron for every 30 hours in Debian

*/30 */30 * * * python /root/get_top.py I'm trying to run a script every 30 hours and 30 minutes. Is the syntax above proper for that? I've had multiple people tell me that */30 is not a valid ...
0
votes
2answers
63 views

Is a restart of cron or crond necessary after each new schedule addition or modification?

When I schedule a job, some seem to be applied immediately, while others after a reboot. So is it recommended to restart cron (crond) after adding a new cron job? How to do that properly (esp. in a ...
-2
votes
1answer
52 views

Is there a better way to stop and restart Apache server every 30 minutes? [closed]

I have to stop and restart Apache every 30 minutes in order to avoid it becoming extremely slow over time. The cron job that I use as follows: @echo off rem Launch google.com, wait 2 seconds, then ...
0
votes
2answers
62 views

Backup of svn repository and mysql database on daily basis

How do I instruct Ubuntu 13.10 server to: zip svn repository dump mysql database into .sql script tar both files copy backup tar onto sdb disk Are there any premade tools for such kind of ...
29
votes
14answers
3k views

Run unix command precisely at very short intervals WITHOUT accumulating time lag over time

Question I'd like to be able to run a UNIX command precisely every second over a long time period. I need a solution, which does not lag behind after a certain time, because of the time the command ...
2
votes
2answers
57 views

Running cron.daily in parallel

Being able to put a script in /etc/cron.daily is really nice because I can do it easily from a configuration management system or a package. However, my understanding is that all the entries in ...
2
votes
4answers
66 views

Cron not running my script

I'm not sure why but my app never executes when I reboot my machine. In crontab > crontab -e I see @reboot /root/myscriptname.sh The file is #!/bin/bash nohup mono-sgen /root/myapp.exe ...
1
vote
1answer
29 views

Use /etc/init.d/fetchmail with the personnal ~/.fetchmailrc

Now, I have two users in my system using fetchmail with a personal ~/.fetchmailrc and syncing there mails with the command fetchmail -kv --uidl -m '\''/usr/bin/procmail -d %T'\ (In a cron but this ...
1
vote
1answer
52 views

Logrotate not picking up or acting on new configuration file

I had a logrotate configuration file set up for a log (let's call it Log1). It is working fine and the log is rotating everyday as expected. Yesterday I cloned this set up and modified it for three ...
1
vote
0answers
24 views

Why am I not receiving any system e-mails? [closed]

In my crontab, I have the following: * * * * * sh /home/rimmer/test.sh In /home/rimmer/test.sh I have the following: #!/bin/bash echo 'test'; I have also set chmod +x /home/rimmer/test.sh, of ...
2
votes
3answers
77 views

Installing crontab using bash script

I have created a script to install two scripts on to the crontab. #!/bin/bash sudo crontab -l > mycron #echo new cron into cron file echo "*/05 * * * * bash ...
1
vote
1answer
38 views

Debian, nonroot, cron, bash script and rebooting at specific time

As nonroot user, how can I schedule a reboot every day at 4:30am? 30 04 * * * /home/user/scripts/reboot.sh As a nonroot normal user, I'm sure the system won't allow me to use the reboot command. ...
1
vote
1answer
70 views

crontab is giving only 2045 lines of output instead of 6000 lines

I am executing one shell script with crontab which has to give more than 6000 lines output only it is giving output up to 2045 lines then coming out. when I run that shell script it is working fine ...
1
vote
1answer
31 views

Is it possible to use the at command to schedule a job to run at a given timestamp?

I want to schedule a file to run using the at command, as described in this tutorial. I see that the at command supports the posix format -- but I don't see any mention of timestamps. Surely it is ...