Cron is used to execute scheduled commands. It acts as a task scheduler on Linux and UNIX systems which will execute commands at specified times set by the user. Cron has a great deal of customization and is often used on server environments where common tasks are run on a regular basis.

learn more… | top users | synonyms (2)

1
vote
1answer
3k views

How can I use cron-apt to download and install updates between midnight and 5am?

I have capped data which is essentially free between midnight and 5am. As a result, I would like to set Ubuntu to automatically download updates over that time. It seems that cron-apt is what I need, ...
0
votes
3answers
874 views

Searching in crontab

I'm pretty new to ubuntu and cron, and I was wondering how to search for something in the crontab file. Basiclly, the ubuntu equivilent of ctrl+f on windows. thanks
5
votes
1answer
326 views

Is it possible to use the 'screen' command to work with files on an encrypted home directory?

So I have an encrypted home directory, set up during install on a server running Ubuntu 12.04 LTS. I attempted to use screen in order to run a script that accesses the data in my home directory after ...
4
votes
2answers
9k views

How to run crontab as user:www-data?

My LAMP is setup to work as user:www-data and all files and folders are created with that permissions. I have setup for crontab as user@ubuntu. So i do crontab -e and use this command: */5 * * * * ...
1
vote
4answers
1k views

How do I get this script to run periodically via cron?

I made a script that sends my local sensors temperature to a server in the internet and then I can see a graph of it. Everything works fine when I execute it manully. I have the latest ubuntu version. ...
3
votes
1answer
1k views

How to start a never ending script at startup

I'm trying to automatically run a never ending script (so it doesn't return 0 on exit) at startup on my headless ubuntu 12.04 server with no GUI. I have tried @reboot nohup /home/luke/netup.sh & ...
2
votes
2answers
942 views

Why isn't cron running my script?

Now I want to use Backup and Whenever gem to automatic backup my database. When I connect the server by ssh as an added user to run backup perform -t my_backup,it works well.But the cron file: 0 22 * ...
0
votes
1answer
4k views

Setting MAILTO=“” for cron in Ubuntu

I have tried setting MAILTO="" under /etc/crontab and /etc/default/cron, but I still receive mail notifications from cron. Is there a single place to disable all mail from cron, as opposed to per-task ...
2
votes
3answers
2k views

Getting notified of failed cron jobs

I'm concerned that cron jobs can fail silently for an indefinite period of time on vanilla Ubuntu Desktop 12.04.1 (Precise), and no one will notice. I would like to get a notification whenever a ...
3
votes
2answers
441 views

rename files inside a folder in real time

Is there a way to rename files inside a folder as they're created? I could run a cron job every few seconds to do something like... find . -name "file.*" -exec sh -c 'echo mv "$1" "$(echo "$1" | sed ...
2
votes
2answers
438 views

add cron job to foreground

I am trying to run a program that pops up a graphical notice to me. As a simple example, I have my cron settings as @hourly xlogo and if I launch xlogo from an interactive command, it works fine. ...
0
votes
1answer
426 views

setting up anacron for version control update

I store some of my configuration files in version control. Recently I tried to setup a daily anacron job so that I won't have to manually update the files. I have never used cron or anacron before but ...
3
votes
2answers
4k views

How can I set up a php script to run via cron?

How can I set up a php script to run via cron I've created a file in the cron.d folder with the username as the file name: /etc/cron.d/username Inside of username file I placed the following cron ...
1
vote
1answer
2k views

Why doesn't this script output to a text file when run from cron?

I have created a Shell Script as below Sample.sh echo "Hi there" I also added cron job in cron tab which is under /etc/crontab as below * * * * * /home/Sample.sh > /home/Sample.txt I have ...
0
votes
1answer
996 views

Cron service up but apparently not working

I'm trying cron in a Ubuntu VPS with a minimal install, so I had to run apt-get install cron. However, say I run crontab -e and add (as root) the following line: * * * * * date >> /root/datelog ...
4
votes
2answers
3k views

How to make a bash script generate a new filename every time it's run?

I'd like to make a .tar file of a particular directory every day of the week. The way I'd like to do it is with a bash script making a tar file every day with crontab. I was wondering, is there a ...
5
votes
2answers
16k views

How to stop email report from Cron <root@machine> (hourly)

I'm running an Ubuntu 12.04, I've configured "ssmtp" with my gmail account and now I'm getting every hour an email with a report, this is an example: From: root <my@gmail.com> Date: 2012/8/13 ...
1
vote
2answers
2k views

crontab Suddenly Stopped Working

Ok so here is my problem, I recently updated my server and change some jsp files which are used to do automatic announcements. The crontab has all the .sh files listed within it and the .sh files run ...
24
votes
3answers
47k views

How to run a cron job using the sudo command

Is it possible to run a cron job which needs the sudo command? Like: sudo rm somefile
-2
votes
1answer
351 views

rsync password problem

I have a python script. In that, I am using rsync for data transfer between two systems. While running, it ask for password for data transfer. So that I create a password-less run by the below ...
4
votes
1answer
2k views

Why does my computer shuts down itself every morning at 6 AM?

My computer shuts down by itself at a specific time everyday 6:00am. I can't find what's causing it. I'm a long time Windows user and just recently tried Ubuntu. So I don't know anything about Linux ...
0
votes
1answer
422 views

How to start and stop a task using at command?

I want to start download using aria2c everyday at 02:00 am and stop it at 08:00 am. I know I should use at 02:00 at>aria2c .... I don't know how to tell 'at' to stop it! Actually aria2c stops ...
3
votes
3answers
14k views

How do I configure exim4 to send mail through a password protected ssl smtp mail server?

I'd like my cronjobs to be able to send mail from my home computer. My servers configure exim4 like this: dc_eximconfig_configtype='internet' dc_other_hostnames='' dc_local_interfaces='127.0.0.1' ...
5
votes
1answer
4k views

How to start / stop Dropbox at a specific time

I have setup a service on my Ubuntu 10.04.4 LTS server, which works when started and stopped manually using sudo service <service> start etc. However I would like to have the service (dropbox ...
2
votes
2answers
253 views

crontab not working as expected

I'm using ubuntu 12.04 and I want to execute a script every 5 hours . I setup cron with crontab -e and putted * */5 * * * sh /home/cron_script.sh The script is executed every minute. Thanks.
1
vote
1answer
10k views

Cron job not executing

I was making a cron job to save my Minecraft world from my ram every 5 minutes. I tested the script and it seems to be working. This is what the script looks like: #!/bin/sh ...
0
votes
1answer
715 views

Telnet output file DOES NOT WORK Correctly UNDER Crontab

I'm using the Ubuntu 10.04.4LTS, and have Ganglia installed in my computer. I used to get the Gmetad data by typing: telnet localhost 8651 > /test/test.txt or made a .sh file to run it. After ...
1
vote
1answer
1k views

Why does Ubuntu Server run both cron and atd?

From the man pages it appears both do basically the same thing, why have both running on the system at the same time? From the wording in the man pages it looks like cron will repeatedly run programs ...
1
vote
1answer
509 views

Cron job running successfully suddenly reports script is not found

What might cause cron to suddenly report a file it is supposed to run is "not found," when the file hasn't been touched, and in fact, the entire system hasn't been touched since it last ran ...
1
vote
1answer
2k views

Cron not sending email notifications

I'm finishing biulding our new server, based on 12.04 32-bit desktop version. I've set up a few cron tasks, that are running as they're supposed. only, I've added the MAILTO = ...
0
votes
1answer
477 views

Cronjob not working

I have added a new line to my crontab file, but this line won't work. This is the code of my crontab file: # Music scrobbler # Every 5 minutes */5 * * * * php -f /var/www/Music/scrobble/index.php # ...
2
votes
0answers
663 views

Why doesn't duply work when set as a cron job?

I have a problem with a cron job which starts but doesn't complete. Running the command manually works fine. I already read the page about cron issues and solutions here on AskUbuntu, tried the ...
2
votes
2answers
1k views

Only run CRON job if connected to specific wifi network

I am a newbie to scripting on Linux (Lubuntu), but I would like to make a script that runs a cron job only if my laptop is connected to my home wifi. Is this possible? I guess, I could do something ...
8
votes
3answers
31k views

How can I tell if my hourly cron job has run?

I have created a file called ntpdate in /etc/cron.hourly #!/bin/sh /usr/sbin/ntpdate-debian date > /tmp/william_tmp date > /william_tmp date > ~/william_tmp echo test I also did Chmod 755 ...
12
votes
1answer
1k views

What is the story behind the default times set in /etc/crontab?

To my understanding, this is the default configuration of /etc/crontab: # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * ...
3
votes
1answer
609 views

Why does cron.hourly not care about the existence of anacron?

This question came up over in Root Access. Why does the default /etc/crontab not check for existence (and executable flag) of /usr/sbin/anacron for the hourly entry? My /etc/crontab: # m h dom mon ...
0
votes
1answer
969 views

Why isn't this simple CRON job working?

I am on Ubuntu server and would like to send an email to myself every 10 minutes (as a test). The code for that is in this file: /var/www/cron-test.php To set up the cron I typed: crontab -e ...
0
votes
1answer
830 views

Split a large XML file by a certain node into smaller files

I've got a XML file with 1GB (about 6000000 Lines). The goal is to split this file into smaller .xml files with more or less 20000 lines each. <?xml version="1.0" encoding="UTF-8"?> ...
2
votes
3answers
6k views

Deleting a file owned by root

Recently, a friend played a prank on my pc and now I have a file sitting on my desktop called 'hardcore_porn_xxx'. The problem is it does not go away by a simple delete. I'm new to linux so any help ...
0
votes
2answers
589 views

Set server timezone but not working with crontab and phpmyadmin

TimeZone is not working properly I am using linode server running ubuntu 12.04LTS. My Question is when i configured timezone by using dpkg reconfigure tz as IST ASIA/Calcutta. It shows correct ...
0
votes
1answer
305 views

Cron reinstallation

Can cron be reinstalled? If so, how to take cron job backups created by system and applications like postfix, apache etc., Now after taking backups how to reinstall cron?
0
votes
2answers
606 views

Cron job fails for any time other than default * * * * *

On Ubuntu 11.10 (Oneiric Ocelot), my cron job run fine if I use the default * * * * * But if I want it to run at 17 hrs or any other time, it never runs. My settings are: 00 17 * * * wget ...
1
vote
1answer
2k views

In what order do cron jobs with the same schedule run?

Let's say that I have the following cron jobs: * * * * * /path/to/taskB * * * * * /path/to/taskC * * * * * /path/to/taskA Is there any guarantee to the order in which they will be run? I've seen ...
1
vote
1answer
1k views

How can I prevent two shell scripts running at the same time?

I have a tar backup script that runs once a month. It runs at night through cron. I also have a power schedule that reboots the server at 4.15 every night. The problem is that the server reboots ...
1
vote
2answers
1k views

How to get updated IP address mailed to me in DNSExit?

I'm using DNSExit on my Ubuntu server (Natty 11.04) and have installed the ipUpdate rpm file and did an apt-get install for chkconfig to enable the ipUpdate. I'd like to get an email whenever the IP ...
10
votes
4answers
5k views

Generic solution to prevent a long cron job from running in parallel?

I am looking for a simple and generic solution that would allow you to execute any script or application in crontab and prevent it from running twice. The solution should be independent on the ...
3
votes
4answers
1k views

Cron not able to succesfully change background

I'm running 12.04 with a custom XML background (modification on Day of Ubuntu) that changes based on time of day. I've noticed that there's a significant delay between when the changes are scheduled ...
-1
votes
2answers
19k views

Crontab not working

I know that this was asked several times, but I don't know what to do... I've tried all the solutions proposed on AskUbuntu, but with no results... So... I have this shell script in my home ...
2
votes
1answer
755 views

Cron job not executing?

I'm trying to execute a PHP script every two minutes on my server, but it doesn't seem to be working. I'm using the following cron job: 2 * * * * /usr/bin/php ...
1
vote
2answers
4k views

Mutt runng from Crontab

I have a bash script that is sending an email through command line mutt. This bash script is being called from a cron job (setup using crontab -e because of permissions needed to do all items in the ...