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)

5
votes
4answers
14k views

How to restart every 30 minutes automatically?

I would like to schedule a restart of my Ubuntu every 30 minutes. Is there any command or a graphical way to do it?
1
vote
3answers
1k 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 ...
1
vote
1answer
9k 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
2answers
3k views

Wget Scheme Missing

When I run Wget from terminal with command wget targetfile.php I got error "Scheme Missing". What does it is suppose to mean and how to fix it? I googled but all links I found is speaking of drupal ...
0
votes
1answer
4k 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/ ...
2
votes
2answers
5k 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
314 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
50 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
0answers
132 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
2answers
2k views

Auto shutdown server if there was no activity

My server should shutdown after 01:00 am, if there was no activity in the past hour. Lets say there was the last connection at 00:43 then it should check again at 01:43. How to write such a ...
1
vote
1answer
228 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 ...
24
votes
3answers
42k views

“(CRON) info (No MTA installed, discarding output)” error in the syslog

I have a fresh install of Ubuntu 12.04.1 LTS an a number of servers. I have not added any cron jobs or edited my crontab on those servers, however, at around the same time for each machine, I get a ...
1
vote
1answer
356 views

Crontab opens as blank page, cannot save

I am really not familiar with linux, and only started using it recently, so be patient with me. I am trying to control a camera on regular intervals through a script that is called upon in the ...
0
votes
1answer
3k 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?
-2
votes
3answers
2k 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
178 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 ...
1
vote
0answers
75 views

Need to send a simple .txt file to a couple email addresses

ive been trying to get this to work all night. mutt doesnt seem to work and I cant install mail or mailx packages because apt-get gives me errors about them not having installation candidate. What I ...
20
votes
4answers
28k views

Where is the user crontab stored?

Since upgrading my user's crontab has been wiped out. This is not the first time this has happened this year and it's a pain restoring it each time. I'd like to be able to back up the crontab for my ...
2
votes
1answer
1k 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?
0
votes
2answers
827 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 ...
1
vote
2answers
59 views

Crontab Instances

I have been doing some research on scheduling tasks and what not. I came across the crontab command function. Is crontab a file that is created or is it a command? If it is a file, then how many can ...
0
votes
1answer
63 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
1answer
816 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 ...
0
votes
1answer
1k 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 ...
0
votes
1answer
1k 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 ...
2
votes
2answers
246 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 ...
3
votes
3answers
168 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 ...
4
votes
2answers
770 views

Ubuntu 12.04 isn't working with one of my crontab commands… any ideas?

In my crontab file (sudo crontab -e) I have the following commands: */1 * * * * wget -q -O /dev/null http://help.mysite.com/inc/mail/hesk_pop3.php 0 7 * * * bash -c "/home/backup/backupscript.sh" ...
2
votes
1answer
330 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
357 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 ...
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
666 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
4
votes
1answer
272 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
7k 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
813 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
2k 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
381 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
336 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
371 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
3k 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
899 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
2k 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 ...
4
votes
2answers
12k 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 ...
19
votes
3answers
37k 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
307 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 ...