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

learn more… | top users | synonyms (1)

2
votes
3answers
2k views

/etc/crontab what does “test -x” stand for

In my /etc/crontab file I have: # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / ...
3
votes
2answers
2k views

How to access X display from a cron job when using gdm3? [duplicate]

Possible Duplicate: Open a window on a remote X display (why “Cannot open display”)? I'm trying to run a cron job that needs access to my X session. I know my X session will ...
5
votes
2answers
309 views

cron every X exact meaning

In cron you can specify */n where n means every n times period, for instance in the first column is minute. */5 means every 5 minutes, but which minutes? 0, 5, 10, ...? What happens if the number ...
3
votes
1answer
433 views

Using rsync + cron to sync a machine behind a firewall with my dropbox

I have a machine (A) behind a firewall with no access to the Internet, on this machine I can NFS mount directories on another machine (B) which can access internet, and is accessible from Internet, ...
0
votes
2answers
1k views

Running Python script via cron with sudo?

Im using Linux Mint. I have written a python script that is designed to not be accessible to the logged in standard user but is still be executed while they are logged in. It is to run and log them ...
2
votes
1answer
794 views

crontab “0/15” minutes + “11-15” hour field: when does that end?

Given a crontab expression like "0 0/15 11-15 ? * MON-FRI", how is that parsed? I am correct in assuming the 11-15 does not mean "between 11 and 15" but "when the hour is 11-15, inclusive" - i.e. ...
7
votes
5answers
5k views

Run script in a non interactive shell?

I have a cron job that is running a script. When I run the script via an interactive shell (ssh'ed to bash) it works fine. When the script runs by itself via cron it fails. My guess is that it is ...
1
vote
1answer
3k views

How to remove obsoleted logs with logrotate?

I wanted to remove unnecessary logs automatically , like Xorg.log.0 , and other packed *.gz files , i really don't need that on a laptop system. However , i checked man logrotate , but only an entry ...
27
votes
10answers
13k 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
1answer
334 views

vixie-cron.x86_64 doesn't seem to execute jobs on crontab

I have installed crontab on CentOS 5.6 x64 via yum install vixie-cron.x86_64 Here is my crontab -e SHELL=/bin/sh 0 0 * * * cat /root/mysql-backup.txt | xargs ...
6
votes
2answers
4k views

Can I automate tar's multi-volume-feature?

Ok, so I've just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a quite nice multi-volume feature, although when I try it ...
3
votes
2answers
959 views

How to start the cron daemon

I am using RHEL 5.4 I killed the cron daemon accidentally. I wanted to stop a cron task, didn't know how to do it, ended up killing the cron daemon itself. How do I start it again?
3
votes
3answers
11k views

How do I add an entry to my crontab?

I am using crontab for the first time. Want to write a few very simple test cron tasks, and run them. $crontab * * * * * echo "Hi" doesn't produce anything. crontab */1 * * * * echo "hi" says ...
4
votes
2answers
3k views

How to run a cronjob in my regular environment?

Both the shell and environment variables that cronjobs are run in is completely different from the ones presented to me in gnome-terminal. How can I run a cronjob under the same circumstances as if I ...
2
votes
1answer
144 views

Need to find a cronjob

I have a problem, some user ,and I'm not sure who, on one of my servers wrote a cronjob that executes every night at midnight. The cronjob creates a sql dump of a database which is then grabbed by ...
0
votes
1answer
184 views

Is there a way to combine a file with crontab?

I'm trying to create an interface that will show a message on the screen every set time. Cron is an ideal tool for this case only it doesn't read data from a file during it's run (as far as I could ...
4
votes
5answers
2k views

How can I use cron to display messages on the screen via notify-send

I am toying around with notify-send and cron (on an Arch machine) and I can't figure out a way to combine them: I tried the solution given here and here, but neither worked. How can I use them? ...
3
votes
3answers
845 views

Is crontab multithread?

I don't know where I can find more information about crontab, so I ask here. Crontab is it multithread? How does it work?
1
vote
1answer
3k views

Cron job not executing

I'm trying to use cron for the first time, and I'm stuck. I'm using Ubuntu 10.10, and the following is my /etc/crontab file. The only modification that I've made is appending the last line. I've ...
3
votes
1answer
733 views

How to use cron + python to regularly adjust screen brightness?

I want to use cron and this script (http://askubuntu.com/questions/23593/use-webcam-to-sense-lighting-condition-and-adjust-screen-brightness): import opencv import opencv.highgui import time import ...
3
votes
1answer
554 views

Scheduled task on reboot

How can I schedule a task to run on next reboot? I understand that we have tools like cron and at to help with scheduling. But they seem to allow scheduling at a specific time and not on specific ...
0
votes
3answers
752 views

How to use gnome-session-save from cron?

I am trying to issue the gnome-session-save --kill command via crontab. I used the command sudo crontab -e. In the file is this: PATH=/usr/bin 00 00 * * * gnome-session-save --kill The command does ...
2
votes
1answer
277 views

Cron & Gnu Screen - Trouble with detached screen [duplicate]

Possible Duplicate: sending text input to a detached screen I have a script for my Minecraft server that runs automatically every 15 minutes. The problem is that after a server reboot, ...
5
votes
2answers
1k views

Open emacs in a terminal when editing crontab

I have setup emacs as my default editor in /etc/profile. When I want to use emacs in a terminal. I open it with the -nw option. How can I have the same behavior when doing a crontab -e preventing it ...
2
votes
1answer
611 views

Check for process already running in webfaction?

I use Django framework on webfaction and have 5 different cron jobs. One of them lasts much longer than others and sometimes gets stuck (30-120 seconds or more). I have already set that cron job to ...
10
votes
6answers
1k views

CronJob every 25 minutes

I want to know whether there is any easier way to run a job every 25 minutes. In cronjob, if you specify the minute parameter as */25, it'll run only on 25th and 50th minute of every hour
3
votes
3answers
4k views

linux cron: want to backup a folder

Hello I would like to backup a folder using cron on a centos. The folder c2duo_mms is located in /usr/local/src/djcode/c2duo_mms. I would like it backed ip every 1:00pm on Tuedays to my home folder ...
9
votes
2answers
1k views

How can I delete all files in a folder that haven't been accessed in a certain amount of time?

I'd like to run a nightly cron job that deletes all the files in a folder that haven't been accessed in a week or more. What is the most efficient way to do this in bash?
15
votes
2answers
8k views

How can I tell cron to run a command every other day (odd/even)

When configuring cron to run a command every other day using the "Day of Month" field, like so: 1 22 */2 * * COMMAND it runs every time the day of month is odd: 1,3,5,7,9 and so on. How can I ...
4
votes
1answer
494 views

How can i dump /tmp/files in CentOS to Dropbox using crontab?

How can i dump files from my CentOS box to Dropbox account? As regular nightly backup task.
3
votes
3answers
5k views

Can I use logrotate to compress daily (date named) logs?

I have logs in the following format: YYYYMMDD I want to compress old logs (older then current day) and maybe move them to a different directory afterwards. Can I do this in logrotate, or do I have ...
2
votes
1answer
230 views

Can I bypass crontab command by putting the file?

I need to create and put my cron file with cat cronfile1 cronfile2 > cronfile crontab cronfile -u myuser This works for me, but I want to know if I can do directly cat cronfile1 cronfile2 > ...
2
votes
2answers
2k views

stop parallel processing for a cron triggered process

I have configured my webservers cron jobs to trigger some php script, every 15min, but sometimes the script takes morethan 15 min to complete execution, by the time another process of the same script ...
1
vote
1answer
150 views

How to list the actual cronjobs?

If I (e.g.: under Fedora) edit the crontab file with vim, then I restart crond: /etc/init.d/crond restart then the actual crontab file: "/etc/crontab" is the same as the actual cronjobs in reality. ...
4
votes
3answers
6k views

How to add unique id to file name in cron job?

My cronjob looks like this: 5 3 * * * mysqldump -u root test > /srv/backup/mysql_daily.dump How can I make filename unique for every time when cronjob writes mysql_daily.dump?
3
votes
1answer
3k views

cron not executing?

I have the following cron tab installed: crontab -l # m h dom mon dow command */10 * * * * "echo" >> /tmp/cron.log The server is at rackspace, it's a cloud server: Linux myserver #8 SMP ...
9
votes
1answer
8k views

Cron log on debian systems

On Redhat systems cron logs into /var/log/cron file. What is the equivalent of that file on Debian systems?
2
votes
1answer
2k views

Cron daemon error : Permission Denied

I am having trouble setting up a cron job. My set up is as follows: crontab -e */10 * * * * OTP_ProJect/PandaServerInfo/SVN/PandaQueueMonitoring/trunk/submit_cron_test.sh the shell script has ...
7
votes
3answers
10k 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?
1
vote
1answer
1k views

Cron: My crontabs don't seem to be doing anything at all

I think I'm missing something. I've set up some crontabs to handle rsyncs over ssh in my office to handle some backups, but they don't seem to be running OR logging, for that matter. Am I missing ...
3
votes
2answers
2k views

Configuring cron.hourly

I am unable to configure a cron job to run by placing it in /etc/cron.hourly folder. SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # run-parts 01 * * * * root run-parts ...
1
vote
3answers
492 views

Why does Crontab give me an error with my PHP script when running it from the terminal does not?

I'm having some problems with running the Crontab with PHP files. I have this same php scripts running in the Crontab for more than 6 months but some days ago mysteriously they stopped to execute the ...
2
votes
1answer
955 views

Are changes in crontab applied when the file is saved, or when the editor is closed?

When I do crontab -e, are the changes applied immediately when I save the file, or do I have to exit vim for it to be applied?
15
votes
6answers
35k views

Why did my crontab not trigger?

I used crontab -e to add the following line to my crontab: * * * * * echo hi >> /home/myusername/test Yet, I don't see that the test file is written to. Is this a permission problem, or is ...
2
votes
3answers
251 views

Crontab syntax: using '*' for minutes value

What happens if I use '*' for the minutes value? Is the command going to be run every minute? For example: * 4 * * 0 <command>
5
votes
2answers
5k views

Not able to ssh in to remote machine using shell script in Crontab

Below is the script which i am trying to run, which runs without any issue for i in `seq 200 2100` do usr=(`ssh -t -t -o ConnectTimeout=60 machine$1 finger | tail -1 | awk '{print$1}'`) echo ...
9
votes
5answers
19k views

Using the system date / time in a Cron Script

I'm setting up a Cronjob that will backup a MySQL database I have in my server, but I don't want it to keep overwriting the same file over and over again. Instead, I want to have an array of backups ...
8
votes
2answers
6k views

Bash Script on Startup? (Linux)

Is there any way to make/run a bash script on reboot (like in Debian/Ubuntu for instance, since thats what my 2 boxes at home have) Also, any recommended guides for doing cron jobs? I'm completely ...
12
votes
2answers
40k views

How can get a list of all scheduled cron jobs on my machine?

My sysadmin has set up a bunch of cron jobs on my machine. I'd like to know exactly what is scheduled for what time. How can I get that list?
3
votes
4answers
5k views

executing a sh script from the cron

I have a test.sh script #!/bin/sh php /home/v/file.php sh /root/x/some.sh when I execute the file as root from command line it works. sh /home/v/test.sh when I set it to crontab -e (is the root ...