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)

3
votes
1answer
788 views

root cron job not running

I am trying to configure automysqlbackup to run via a cronjob to backup my dbs nightly. When I execute sudo automysqlbackup from a terminal, the process executes as expected and creates the backup ...
1
vote
1answer
123 views

How to prevent automatic apt-get operations from running for a while?

In a production context, we run scripts to configure/customize the OS. It makes intensive use of apt-get (to install, remove, update, upgrade packages). Unfortunately it happens (especially just ...
2
votes
2answers
1k views

How can I use cron to schedule a script that implements daylight saving on a non- DST aware application when my server automatically uses DST?

My server (running ubuntu 8.04LTS server) reports the time as 9:38PM BST right now. BST (British Summer Time) is 1 hour ahead of UTC (or Greenwich Mean Time if you really want to confuse matters) The ...
2
votes
1answer
526 views

Cronjob for security updates?

I'm having trouble creating a cronjob for automatic security updates on my ubuntu server 12.04. I separated the security sources into a different file, and then did this from within a cronjob: ...
0
votes
2answers
88 views

How to search the location of Shell Script

# 59 23 * * 1 sh /rsync01.sh # 59 23 * * 2 sh /rsync02.sh # 59 23 * * 3 sh /rsync03.sh # 59 23 * * 4 sh /rsync04.sh # 59 23 * * 5 sh /rsync05.sh # 59 23 * * 6 sh /rsync06.sh # 59 23 * * 0 sh ...
3
votes
1answer
6k views

Stop cron from mailing the user

I am facing an issue with Ubuntu server. I am running a PHP script using a cron job which executes every 5 minutes. This folder spool/mqueue is showing 112GB space. The scripts job is to fetch data ...
0
votes
2answers
287 views

Where should I start crond?

On my Ubuntu server (LTS 12.04) I would like crond to be running every time I boot up. Where should I configure this? I took a look at service --status-all and saw that cron was there, but it was ...
0
votes
1answer
294 views

Why does mplayer freeze when running from Scheduled Tasks?

I've been trying to use Scheduled Tasks and mplayer as an alarm clock, scheduling mplayer /path/to/file.mp3 for my morning wakeup time, but whenever it reaches the scheduled time, mplayer freezes only ...
3
votes
3answers
2k views

Cron works, but scheduled job to open webpage in chrome does not

Updates START A friend of mine just answered this. I need to do this export DISPLAY=:0 && <my GUI dependent command here> Waiting for him to post the answer here. I have tried ...
2
votes
1answer
447 views

Crontab kill firefox processes

I want to make a crontab job for killing any firefox processes running, if there is more than a max number of processes running, starting with the oldest process. So let's say 5 processes is running ...
3
votes
1answer
9k views

Add cron job on startup from a script

I would like to add a command to be run at startup from within a shell script. For example, I run the script once and it adds the cron job, so from that time on, each time the OS starts, a specific ...
1
vote
1answer
17k views

Daily server reboot cron?

I want to create a cron job which executes daiy at assigned time and it restart the ubuntu server. I try to add reboot only in cron, but it is not working, whereas it works when I try to execute it ...
0
votes
1answer
5k views

Crontab and Shell Script not Executing [duplicate]

Anybody any suggestions on why my crontab and shell script is not running. I have chmod +x my shell script and added the following into crontab -e */5 * * * * bash cd /home/jclark/scrips/ipcheck/ ...
4
votes
2answers
10k views

How can I disable postfix on startup?

I can't get cron to stop spamming me with completed job notifications. It's getting out of hand and starting to clog up my 'real' email server, so I'd like to just disable postfix while I figure out ...
0
votes
1answer
640 views

sqlite3 timestamp (current_timestamp) one hour off

I run a small crawler on a virtual ubuntu server, initiated by crontab hourly. Datetime is inserted by defaulting the date filed to TIMESTAMP DEFAULT CURRENT_TIMESTAMP. Table creation looks like ...
0
votes
1answer
53 views

Execure a random command from .txt file?

I have a Ubuntu server, and I'm trying to print a Twitter quote using the app "twidge". So I made a list of tweets on a .txt file. I want to print one tweet (per line) from that file and send it to ...
1
vote
1answer
56 views

at job facility for anacron?

Is there a tool for Ubuntu to schedule jobs similar to at but for anacron instead if plain cron? Eg. echo "rm -Rf /tmp/workdata.$$.*" | at now + 99 minutes It doesn't have to be via anacron, just ...
1
vote
0answers
231 views

How to trigger anacron start if USB drive connected

There is a script in /usr/lib/pm-utils/power.d/anacron which restarts anacron if leptops are connected to power. Is it possible to have a similar script restart anacron if (a certain) USB-drive is ...
1
vote
1answer
324 views

debuild -S in cronjob: how to avoid interactive gpg

I would like to build and submit a package to a launchpad Ubuntu reposiory of mine in a nightly cronjob. To this end, I'll have to debuild -S the package which by default requires human interaction ...
-2
votes
3answers
5k views

How to run cronjob in a time specific time range

How to create a cronjob that will execute some code from 8:30AM to 8:14PM.
1
vote
1answer
5k views

How to run a cronjob after every 5minutes

I've tried to run a cronjob like this: 30/5 13-14 * * * .... i.e I want to run the cron every 5minutes from 1:30PM to 2:30PM. But it doesn't seems to work. Am I doing something wrong?
1
vote
1answer
239 views

Crron job not running properly

Crontab runs my script but file that are fetched are of 0 kb and when i am running my script scheduled by own i.e ./getMSC.sh $1 $2 its running and files are also fetched Please suggest me why this ...
0
votes
1answer
2k views

Running CRON job on Ubuntu server for SugarCRM

I am pretty inexperienced in Linux, so be descriptive on your answer. My environment: Local Linux server 12.04 hosting Sugar CRM 6.5.2. There is area in sugar CRM called scheduler. I can configured ...
4
votes
3answers
2k views

cron jobs not running

I've got a couple of scripts that I've had scheduled to run in cron for a while. About a week or so ago, they stopped running as far as the (very basic) logging showed, and also I noticed that my ...
0
votes
2answers
2k views

How to mkdir -p -m 777 to all missing pathname directories?

I'm putting a file in cron.hourly which needs to create a folder on the 1st time, and giving it access to an user so i don't need to use sudo if i want to remove all content in the folder. And in it ...
3
votes
1answer
3k views

run script every last thursday of the month

How to make a script run at e.g. 16:00 every last thursday of the month using gnome-schedule or cron?
4
votes
1answer
1k views

Is there a programmable way to tell if the screen is locked?

I have lots of stuff in my crontab, including some that talks to my screen. If I'm not there for it to be notifying, I don't really want it to run. Is there a way I can check to see if the computer ...
0
votes
1answer
71 views

For processes to be up and running all the time

I want my python program sample.py to be always up and running. I have read some things and asked people about ways to do this. So far I have following options - Upstart Cron I am trying things ...
2
votes
3answers
1k views

What is the easiest, most effective backup system for Ubuntu Servers?

I'm trying to backup my /var/www/ folder, MySQL, and any other special documents like in the /etc/apache2/ folder. Does anyone have any solutions for backup software? Maybe something that's ...
2
votes
1answer
1k views

Cron script to detect degraded raid array?

To my surprise, my raid array entered degraded mode some time ago. How can I set up a cron job to warn me? I've tried from the mdadm man page: Running mdadm --monitor --scan -1 from a cron script ...
2
votes
2answers
361 views

How to store sensitive information (passwords) so it can be accessed by cronjob?

I'm writing an extension to a python program that will need to store passwords and need to access them during non interactive cronjobs (during the user is not logged in). My first approach was to use ...
1
vote
1answer
2k views

Cron cannot run gnome-terminal

I set the following cron in my local machine. * * * * * /bin/bash -c /home/JSX/Stuff/J/login-check/open-console.sh The content of open-console.sh is the following:- #! /bin/sh gnome-terminal ...
5
votes
1answer
394 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 ...
3
votes
3answers
221 views

How to run a command within a time duration per min/sec?

I want to run a command/shell script say script.sh from 1AM to 2AM per minute. After observing that crontab can't work it out 'per sec' I had to go with 'per min'. Basically, My server.sh file takes ...
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 ...
3
votes
1answer
532 views

scrot (screenshot) cron job not executing

I'm trying to execute a cron job with Scrot (screenshot utility) but it won't work. At first I thought it was a directory problem. I wrote my.png by itself at first, which could have been dropping ...
2
votes
1answer
4k 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, ...
1
vote
4answers
2k 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. ...
2
votes
2answers
1k 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 * ...
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 & ...
0
votes
1answer
5k 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 ...
3
votes
2answers
528 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
576 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
498 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
7k 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 ...
2
votes
1answer
3k 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
1k 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
4k 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 ...
1
vote
2answers
3k 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 ...
-2
votes
1answer
421 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 ...