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

learn more… | top users | synonyms (1)

0
votes
1answer
25 views

Are the crontabs of users linked?

Our Linux server has a community user that has a crontab for itself. The admins don't want me to schedule my scripts on their crontab because they don't want to take responsibility for my programming. ...
2
votes
1answer
191 views

kill process in script while writing file behavior

in my php script which runs as a cron job, I have foreach($sites as $site) { exec('./wkhtmltoimage-amd64 ' . $site . ' somefile.png'); exec('./zopflipng -y somefile.png somefile.png'); } ...
0
votes
1answer
18 views

crontab nodification is taking too much time

There are 300 processes configured in a single Linux server's crontab. if I want to stop or modify any of them, I have to comment them out (i.e. # ..cron..) for all processes. It's a time consuming ...
1
vote
1answer
72 views

Execution behaviour of cron

I want to schedule a cron so as to avoid running at midnight. I was thinking a period of 7 minutes. Now, I figured out with 7 minutes of interval, the last cron schedule for a particular day would be ...
1
vote
0answers
53 views

Create a fake read only device like file with incrond

I need to generate UUID with uuidgen (not through any function call, but external command, because processes which will read the file cannot call any APIs or external commands directly). My idea is ...
0
votes
0answers
23 views

Run Xdotool on multiple users at once

When running Xdotool on user one (cron): * * * * * export DISPLAY=:0 && xdotool mousemove 10 10 and I switch to user two for several hours, and back to user one, I find out Xdotool not ...
1
vote
1answer
2k views

sh script will not execute as root (cron)

I have the following script added to cron. If I add touch thisisatest.file to the first line it will create a file named thisisatest.file, but not execute the rest of the code. If I manually type ...
6
votes
2answers
6k views

crontab's @reboot only works for root?

man 5 crontab is pretty clear on how to use crontab to run a script on boot: These special time specification "nicknames" are supported, which replace the 5 initial time and date fields, and ...
1
vote
1answer
2k views

running a script every 30 minutes with crontab using ROOT (Debian)

When I manually type: root@username:~# ./myscript.sh the script executes, however I tried the following combinations to have crontab execute myscript.sh every 30 minutes (forever) and none seem to ...
1
vote
2answers
179 views

Script from cron doesn't create archive

I'm using: # cat /etc/redhat-release CentOS release 6.4 (Final) Have an script in user's crontab: $ crontab -l 0 7 * * * /home/teamcity/scripts/TC_backup.sh If I run this script under this very ...
3
votes
3answers
551 views

Bash script to delete a file called index.html recursively

I need a bash script (not sure how to write the actual .sh file) which I could set to be run by cron every minute and that would delete files with the name index.html that are in a specific directory ...
0
votes
1answer
1k views

What causes cron to continuously send mail and how can I disable it?

I have a problem on CentOS 6.3 system where the crond process tries to unsuccessfully send mail over and over (at least I think this is what its doing) until the OS eventually generates a "too many ...
2
votes
1answer
896 views

“stdin: is not a tty” mails for running scripts as cron jobs

I have several shell scripts (bash) which are started by cron. Every time a script is executed I get an email saying "stdin: is not a tty". Can someone please tell me how to fix this? All scripts run ...
1
vote
0answers
32 views

Unplug AC causes anacron to stop. No resumumption if cron.daily had already started?

Anacron is started/stopped by a number of means, one of which is when AC power is plugged/unplugged, as can be seen by examining /etc/apm/event.d/anacron and /usr/lib/pm-utils/power.d/anacron. You can ...
1
vote
1answer
186 views

Rotating iptables logs, strange message about script being converted to upstart job

I use a script /etc/logrotate.d/iptables containing entries like: /var/log/in_iptables.log { rotate 4 weekly missingok notifempty compress ...
0
votes
0answers
43 views

How do I interpret an entry about cron in Gnome System Log Viewer

Apologies if this turns out to be a trivial question. I am trying to set up a regular backup of my files prior to installing Fedora 19 instead of my current Fedora 12. In November 2013 I started a ...
2
votes
1answer
278 views

Crontab change MAILTO for only one specific job in Root's crontab

Can I do the following to change where mail goes for one specific crontab job in root's crontab (don't sent to root for Do Something job, just send to porklover): # Make a hambone appear * * * * * ...
1
vote
1answer
72 views

Does cron impose some limitations to types of commands and privilege of execution? [duplicate]

I've experienced an issue where some of my scripts run perfectly fine when I call them manually, but these same scripts when called as cron jobs via cron don't seem to work at all. So my question: ...
10
votes
7answers
5k views

How to restart the Python script automatically if it is killed or dies

I am running my Python script in the background in my Ubuntu machine (12.04) like this - nohup python testing.py > test.out & Now, it might be possible that at some stage my above Python ...
1
vote
1answer
136 views

Running cron jobs under php ver. 5.4

My hosting company switched me to php version 5.4. I run a Drupal site (D7.) They say: You'll want to make sure your crons use "/usr/php/54/usr/bin/php" instead, as otherwise it will use PHP 5.2. ...
0
votes
3answers
168 views

Disable cronjob after reboots

How can I prevent cronjobs from automatically starting after my server has rebooted? Every time I reboot my server the cronjobs start up again, which I'd like to prevent. These servers are running ...
0
votes
1answer
219 views

Is this sar/sysstat cron job formatted correctly?

I want it to give me all the sar/sadc options, interrupts,disk,etc.. every 10 seconds starting at noon for the entire hour. On the second line I want to capture the info in /proc/interrupts every ...
2
votes
1answer
94 views

Cron does not execute xinit command

I have a command that works perfectly when launched from the prompt: xinit /home/user/myscript.sh -- /usr/bin/Xvfb :1 -screen 0 1x1x8 But is not executed when put in crontab: @reboot xinit ...
2
votes
1answer
436 views

How to restore default crontab file

I have recently lost my cronjobs. now when i do crontab -e i am presented with an empty file. i would like to get the default file back with the nifty comments and explanaitions at the top!
45
votes
3answers
5k views

Day of week {0-7} in crontab has 8 options, but we have only 7 days in a week

Day-of-week: Allowed range 0 – 7. Sunday is either 0 or 7. I found this after Googling, my question is why should both values (0,7) correspond to Sunday?
2
votes
1answer
245 views

Suddenly lost all cronjobs

All of a sudden my cron jobs don't work any more. When I type crontab -e I am presented an empty file in the editor /tmp/crontab.3fMYGi/crontab And by empty I mean that not even this standard ...
3
votes
3answers
627 views

Is setting a higher nice level for a process an effective way to reduce its impact on system load/CPU time?

I have an rsync cron job which is pushing the server load and triggering monitor alerts. If I set the job to be run with a high nice level, would that effectively reduce the impact it has on system ...
0
votes
2answers
264 views

How to add the logs to a crontab with time stamp [duplicate]

In crontab, I scheduled a daily backup script. Now when the cron executes the script the status are logged to a log file as shown below. 0 0 * * * /home/backup.sh > ...
3
votes
1answer
108 views

How to switch tty with a script / cronjob

Is it possible to switch the current tty/vt with the help of a bash script or a cronjob? I only know the physical keyboard input "Ctrl-Alt-Fx". I would like to show two virtual desktops at different ...
3
votes
2answers
206 views

Bash if script is called from terminal echo stdout to terminal, if from cron do not echo output

I would like to have a service watchdog script echo the status to the screen if called like ./watchdog.sh but if it is run by cron, there is no need to echo output. What is the proper method? Where ...
0
votes
1answer
204 views

Mysterious automated emails

I remember messing around with crontab and setting up email capabilities on a server many months back, and now all of a sudden I'm getting the following email: EMAIL HEADER: from: root ...
3
votes
3answers
65 views

Where to put system cronjobs?

If I need a cronjob that runs at system level (i.e. not specific for a certain user) how do you suggest me to create it? running crontab -e as root appending it to /etc/crontab creating a file ...
0
votes
1answer
602 views

Create cron as a apache user and run as root user

I am creating this cron as apache user and want to run this cron as root, below is my code snippet: # Create a cron job to restart apache cron_file="/etc/cron.d/restart_apache_crontab" cron_job="*/1 ...
0
votes
1answer
90 views

Why don't these cron jobs run?

Here is my crontab: # rsnapshot jobs 0 9-21 * * * /usr/bin/rsnapshot -c /home/kaiyin/.rsnapshot.conf hourly 52 22 * * * /usr/bin/rsnapshot -c /home/kaiyin/.rsnapshot.conf daily 42 22 ...
-1
votes
2answers
206 views

Shell script passing null value while executed as cron job [closed]

We are using the below commands to get pagesapce values and I need to check percent of used pagespace. For this I have used the below code, but when running this script it's passing a null value into ...
0
votes
0answers
54 views

CronTab on OpenShift

I have a robot witch updates a particular page on Wikipedia every 2 hours. I copied it to OpenShift and made a Crontab on my own computer witch connects to OpenShift via ssh and run the robot. How can ...
0
votes
1answer
197 views

How to rebuild /etc/cron.d on CentOS?

I installed an RPM on a CentOS machine that was supposed to merge its own files contained in a /etc/cron.d structure with the current /etc/cron.d. However it replaced the current contents. I believe ...
0
votes
2answers
712 views

create a cronjob to run php script

I've created a cronjob in Xubuntu to run a PHP script in every 5 minutes. I did it as follows. I entered the following command: $ crontab -e Then entered the following: */5 * * * * /usr/bin/php ...
11
votes
4answers
10k views

How do I completely silence a cronjob to /dev/null/?

On my Ubuntu-Desktop and on my debian-server I have a script which needs to be executed each minute (a script that calls the minute-tic of my space online browsergame). The problem is that on ...
0
votes
1answer
4k views

How to use Crontab for a java file in linux

How can I use Crontab in Linux specifically for a Java program? I want to run a MIS Script. How can I crontab it and what should the path be?
1
vote
1answer
69 views

Mailing output of cron

I have this script which I run once a month, and I want to get the output sent to my email. If I run it manually like so, then the standard output is sent to my email. ./monthly_mail.sh | mail -s ...
3
votes
4answers
210 views

Does cron jobs per se represent a significant burden on a modern system?

I'd like to run a pretty simple script (is there a dir with name x in dir y if so move it to dir z–and x will only be there about once a day) every 15 seconds or so (one minute divided into 4*15 ...
0
votes
3answers
71 views

Command to run an application within a specific directory

I want to be able to type a line of command to do the following two commands that I know: cd ~/rpitwit_commands/ rpitwit This is because I want to automatically run it upon boot in crontab, and it ...
0
votes
1answer
467 views

How to check whether my cron job for backup using tar was succesfull [closed]

I have a cron job to tar backup websites and databases and upload the backup to a NAS. Instead of checking the tar files on the NAS. Is there any way to check if the tar backup process completed ...
2
votes
1answer
297 views

How to respawn vpnc when it stops?

As root, I've setup a crontab rule that launches vpnc everyday early in the morning (before I arrive at my workplace). But it often occurs that the vpn stopped mid day. As a result, I have to sudo ...
1
vote
0answers
481 views

wget command not working in cronjob

here is my command : wget -c -O /home/alireza/Desktop/1.mkv http://mysite.com/myfile and here is my /etc/crontab file : SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ 0 2 ...
2
votes
1answer
91 views

How to run a script as soon as the week number changes?

I would like to keep my download folder sorted. My goal is to have the files of the current week in the download folder, and the older files in a folder named after week number and year (eg 2013.09, ...
1
vote
1answer
596 views

Daily logRotate for apache at specific time

How can I execute logRotate daily at a specific time (3h30) each day? Specific details on how to do this would be appreciated. I'm on Debian.
0
votes
0answers
80 views

fcron or followup on debian wheezy (stable)

I've been using fcron for a long time on debian linux. In oldstable it is still existing fcron_oldstable. So sad in the actual stable wheezy there is no fcron_stable. Are there suggestions which cron ...
2
votes
1answer
2k views

Crontab + Ruby on Rails: /usr/bin/env: ruby: No such file or directory

I have a ruby on rails app and I need to schedule a crontab for a rake task. */5 * * * * RAILS_ENV=production /usr/local/bin/rake -f /usr/local/www/mysite-web-production/current/Rakefile ...