cron

Where to put Ruby scripts for script/runner on a Rails project?

I have seen examples where it is put in the lib folder, and another example in the app folder. Is there standard place where it should be put for Rails 2.3.8 and Rails 3 convention? ...

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...

Why do I always need "ruby" in front of "script/runner"??

When I do just script/runner it gives me -bash: script/runner: Permission denied When I do sudo script/runner it gives me sudo: script/runner: command not found It only works when I do ruby script/runner. Why? Everywhere else I see people just run script/runner without the ruby in front of it... Is there a "fix" for this? It's causing ...

Cron expression for particular date

I want a cron expression that represents 6th September 2010 6:00 am ...

cronjob delaying based on PHP output

I'm in charge of a printer, so I wrote a script which runs every 5 minutes and figures out if the printer has paper. If it doesn't, the script will text me. The problem is, if I'm busy, and can't fill the printer, I don't want the script to continue to text me every 5 minutes. Is there a way I can force it to only send me at most 1 tex...

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...

Schedule a cron job for execution every hour on certain days on App Engine

I would like to schedule a cron task to run every hour, but only from Thursday through Monday. Is a schedule like this possible? From the documentation, it looks like I can schedule a cron task to run at an hourly interval or on specific days at a single specific time, but I cannot figure out how to schedule a cron task to run at an ho...

PHP Update Entry Every Hour

Hi, I'm working on a site that generates a dynamic image based on data from another site. The problem is that loading the data from the other site ever time the image is accessed is slow. The Image displays the current stats of a "team" on a tournament website. I want to make a cron job and database that work together to update the info...

Import/Export updated rows in MySQL database via PHP

Hi all, I am currently having two databases that contains same data on two servers. One is a VPS and other one is a reseller account. So, what I want to do is, Import updated rows in few tables from reseller's database and export them to vps's database via PHP. I can add a 'lastupdate' field to database1 and update it's value when any...

How can I run my program code after fixed intervals?

I have this Perl script for monitoring a folder in Linux. To continuously check for any updates to the directory, I have a while loop that sleeps for 5 minutes in-between successive loops : while(1) { ... sleep 300; } Nobody on my other question suggested using cron for scheduling instead of a for loop. This while construct...

stream_socket_client() fails when using in CRON job

Hi All I have a script that runs fine in the browser, however fails when run through CRON. Specifically, the script is using stream_socket_client() to create a secure socket, however despite running fine when I run through the browser, the CRON side fails with the following errors: PHP Warning: stream_socket_client(): Failed to enabl...

PHP code to update MySQL table

I want to update a MySQL table with information from two other tables. I'll set up a cron job, but I don't know what PHP code to use. Every time the cron job runs, I want the 'VideoNumber' column from the 'Profiles' table to be updated with the amount of videos they've uploaded to the site. Video information is stored in a table called...

find the name of user executing the cron

I've got a file index.php. there are 2 users having separate crons running accesing the scripts. is there any function in php/linux to identify which user's cron called that... its a cent-os.. ...

How do I debug this 'no method' error in ruby on rails?

I get the following error: Delayed::Job SomeMailJob# (NoMethodError) "undefined method `subject' for #<YAML::Object:0x2b0a191f4c78>" This comes from the following code which references the SombMailJob above: class SomeMailJob < Struct.new(:contact, :contact_email) def perform OutboundMailer.deliver_campaign_email(contact,co...

GET amount of retweets for all and each tweet from Twitter on GAE?

Hi, I have a service with 1000 users and everyone has tweeted around 1000 times each. So the total amount of tweets from my service is around 1 000 000. And this number is increasing all the time. My question is, how can I get and check the amount of retweets for each tweet without having my service crashing all the time because of "Cr...

How to set Google App Engine cron job using different interval in different period of time?

How to config a cron job to run every 5 minutes between 9:00am~20:00pm, but every 10 minutes in other time of the day. ...

How do I see what's going on with queued jobs using delayed_job?

I have been running delayed_job and was hitting some errors, but now I don't know what is sitting in the job queue or what's going on with them.... How can I figure that out so I can debug whether it is able to execute what has been put in the queue? Here is where I call the job (it is part of a cron task) and the mailer it calls: c...

My php script is not sending an email when called by a cron job

I am running a cron job every five minutes which calls a php script to check to see if users have imported any files for processing. When I run the php script by going to the address in my web browser it runs the script and then sends the user a notification by email. When I run the script using the cron job, the script works fine, but...

Insane crond behavior. keeps making defunct bash processes

I have a crontab that looks like: SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ 0-59 * * * * /var/www/html/private/fivemin/zdaemon.php >> /dev/null & Simple as possible, right? zdaemon.php which I am just testing with is: #!/usr/bin/php <? while(true){ sleep(1); } ?> Whenever it runs it hangs li...

mac os x 10.6.4 launchd cron job stops after 2 days

I have a mac mini os x 10.6.4 which I use to host a web app for private use only. For certain functionality I needed a cron job so i used lingon (http://lingon.sourceforge.net/) to setup a launchd cron job - this creates a plist file in the following folder /library/launchDeamons folder. the job it self is just "curl -s localhost/api?met...