crontab

ubuntu system crontab works, but root crontab does not

I am having a strange problem about ubuntu crontab here. If I add the following line to system crontab(/etc/crontab), it works well */1 * * * * root /bin/date >> /root/text but if I edit root crontab by using crontab -e with root user, and add */1 * * * * /bin/date >> /root/text it does not work at all. Can you please help me on...

Using crontab with django

I need to create a function for sending newsletters everyday from crontab. I've found two ways of doing this on the internet : First - file placed in the django project folder: #! /usr/bin/env python import sys import os from django.core.management import setup_environ import settings setup_environ(settings) from django.core.mail imp...

Running a python script from crontab

I've got a python program which runs via crontab and that works perfectly. However, I decided to add the ability to notify me of what it's doing, and suddenly it's failing. It runs from the command line, however, running it as a crontab program causes it to fail libnotify-Message: Unable to get session bus: /bin/dbus-launch terminated a...

Crontab wont run python script

When I execute my python script from the command line I have no problems like so: [rv@med240-183 db]$ python formatdb.py [rv@med240-183 db]$ When I try to use crontab to run the script every midnight I get a series of errors: import: unable to open X server `' @ import.c/ImportImageCommand/367. /home/rv/ncbi-blast-2.2.23+/db/for...

Writing a Cron Job That Can Access User Data

I'm trying to write a cron job that runs a report, and emails the result to an address defined in my user's ~/.bashrc file. I had this working perfectly on Fedora, but when I switched to Ubuntu, my solution no longer works. The command my cron job currently runs is: . /home/myuser/.bashrc; /home/myuser/bin/runreport If I run that comm...

How to change the time cron.daily is run in linux

I have a script in cron.daily that runs at a certain time every morning. I need to change the time that it is run. How do I change the time cron.daily runs the scripts? ...

Locating most recently updated file recursively in UNIX

For a website I'm working on I want to be able to automatically update the "This page was last modified:" section in the footer as I'm doing my nightly git commit. Essentially I plan on writing a shell script to run at midnight each night which will do all of my general server maintenance. Most of these tasks I already know how to automa...

crontab config issues

I would like to setup a crontab for my thinking_sphinx search feature. I am not using any ruby gems for this. this is my command */59 * * * * cd path && rake thinking_sphinx:index RAILS_ENV=production The syslog gives me this: CRON[2890]: (user) CMD (cd path && rake thinking_sphinx:index RAILS_ENV=production) Yet the thinking_...

Python: File works on the command line but not with crontab

So I have a file that looks like so: #!/usr/bin/python import MySQLdb import subprocess from subprocess import call import re conx = MySQLdb.connect (user = 'root', passwd = '******', db = 'vaxijen_antigens') cursor = conx.cursor() cursor.execute('select * from sequence') row = cursor.fetchall() f = open('/home/rv/ncbi-blast-2.2.23+/d...

How to set up a cron job to run an executable every hour?

I need to set up a cron job that runs an executable compiled using gcc once every hour. I logged in as root and typed crontab -e Then I entered the following and saved the file. 0 * * * * /path_to_executable However, the cron job does not work. I see that when I type /...path_to_executable I get a segmentation fault. I can only ex...

clear phpThumb cache regularly with cron job

Hi there, I am using phpThumb on a client website, and as it is a very image heavy application the cache gets huge quick. Today the thumbs stopped working and I had rename the cache folder, as the folder was too big to delete via ftp. I renamed it cache_old and am trying to delete it now via ssh. I recreated the cache folder and ever...

How can I stop crontab from messing up this simple BASH script (and why is it happening)?

I have a strange issue, relating to running a BASH script via cron (invoked via crontab -e). Here is the script: #!/bin/bash SIG1="$(iwconfig wlan0 | awk '/Quality=/ { print $2} ' | cut -c 9-10)" SIG2="$(iwconfig wlan0 | awk '/Quality=/ { print $2} ' | cut -c 12-13)" echo "$SIG1:$SIG2" >> test.txt exit When run from the commandline...

include(): Failed opening when accessing by Shell/Crontab

I'm setting up a crontab. When accessing the php file directly (domain.com/file-path/file.php) it works perfectly. When accessing it through shell (php -f /var/www/vhosts/domain.com/file-path/file.php) I get include file errors all over the place. It has something to do with the include path being set as: (include_path='.:') Is there an...

Why this expect script gives an error when it's run by cron?

I can run this expect script just fine using root or my own user account, however when I run it with cron, I always get an error. The OS is Ubuntu 8.04. Error email is as follows, Date: Thu, 26 Aug 2010 11:50:01 -0400 From: root@supa (Cron Daemon) To: root@supa Subject: Cron <root@supa> /home/myusername/bin/uploadmyip myserver.com can...

why crontab process run repeated auto at sometimes

sometimes, we found our server's cron process auto repeated, repeated 2 or 3 times when use ps command, I get this: server_xx14:~ # ps aux | grep cron root 2596 0.0 0.0 11188 392 ? Ss 2009 0:25 /usr/sbin/cron root 21706 0.0 0.0 20812 944 ? S 09:30 0:00 /usr/sbin/cron root 23437 0.0 0.0 ...

I need help on ubuntu 9.10 crontab GUI application

need to setup cron every 30 min to start and end Adobe AIR application which is not happening at present. I am using following command. */30 * * * * /opt/myapp/myapp can any one tell me what mistake I am making. What I found was cron does not execute GUI app. Only command lines are accepted jobs are accepted. Please guide me what ne...

Where to place a shell script?

Hello fellow computer people :) I have a shell script that I will use as a watchdog timer. It checks to see if my other 'main' program is running. If it is not, it restarts it. The question is: How do I get this installed on a Mac? Is there a folder/plist file scenario somewhere where the OS will automatically and periodically call the...

Have cron wait for job to finish before re-launching

I have a cronjob that executes every second minute that usually runs in seconds, but sometimes for several minutes. I need cron to not execute the command if it's already running when the next minute comes. The line looks like this */1 * * * * cmd I have tried with this * * * * * ID=job1 FREQ=1m AFTER=job1 cmd but to no success. I...

Linux crontab doesnt launch a script

I have this user crontab (accessed via the command crontab -e): # m h dom mon dow command */3 * * * * sh /home/FRAPS/Desktop/cronCheck.sh The script cronCheck.sh looks like that: #!/bin/sh SERVICE='Script' if ps ax | grep -v grep | grep -i "$SERVICE" > /dev/null then echo "######## $SERVICE service running, everythin...

python script in crontab gets input arguments of another process running at the same time

I run 2 python scripts from crontab at the same time each 30 min, e.g. 00,30 6-19 * * 0-5 /.../x.py site1 */3 6-19 * * 0-5 /.../y.py site2 At the beginning the both scripts make import of a module that prints some data to a log, e.g. name = os.path.basename(sys.argv[0]) site = sys.argv[1] pid = os.getpid() Occasionally (!) the sec...