cron

cron job - geocode address field to lat & long in mySQL database

Has anyone done this, or have an idea? I have a real estate script that for whatever reasons (google mapping limits, script itself) only gets the coordinates for half of the listings. I want to run a script that of the lat & long field are empty the script will use the address, city, state to populate the lat & long fields. THoughts? ...

Cron file - disable access (Google App Engine)

I'm running a cron file in Google App Engine. It seems to be working fine, except I don't want anyone to be able to access the URL. Here is my .cron file: cron: - description: testing cron url: /tester schedule: every 1 minutes I tried adding: "login: admin" underneath "schedule", but I get: enter code here Error parsing yaml file: ...

Drupal: Cron runs but Autoresponder doesn't send email?

Hi All, Within Drupal I have the Autoresponder module installed. I've configured cron to run twice a day which within the status report it's shown as being run successfully - however no emails are being sent from autoresponder.... If I then run cron manually then the emails are sent? Any ideas very much appreciated. Shane ...

php script that calls itself when it is finished - indefinately.

I have a php script that can take anything from 2 to 10 minutes to execute. It fetches info from around the web so its time depends on how fast lots of other things are talking. I used to run the script on a cron every 15 minutes, but sometimes it only takes 2 minutes to run. So I wondered if I can somehow make it run perpetually - set...

Python script to do a GET request on 2 urls in a cron job

I need a python script to perform a GET request on 2 urls. I will use these scripts in a cron job on my ubuntu server. The catch is, the 2 calls have to happen sequentially because the first GET request to Url#1 might take up to 1 minute or so to complete. For the cron job, I want it to run every 30 minutes. ...

Django standalone run in cron

I want to run automatic newsletter function in my crontab, but no matter what I try - I cannot make it work. What is the proper method for doing this ? This is my crontab entry : 0 */2 * * * PYTHONPATH=/home/muntu/rails python2.6 /home/muntu/rails/project/newsletter.py And the newsletter.py file, which is located in the top folder of ...

Adapt code to my mySQL tables

I have a table, "jos_ezrealty" that has address, city, state fields and declat & declong for latitude and longitude. I need to adapt the code below (provided by google - http://code.google.com/apis/maps/articles/phpsqlgeocode.html) to work with my table. All of my address fields are filled, and half of my lat & long fields are filled. I ...

PHP: Error trying to run a script via Cron job

Hi all, I have setup a cron job via my Control panel. I have uploaded the script via my FTP, set up it's permission as 777 (is it safe to do so?) & gave the path to this script in the job. Now the script makes use of dependent scripts to be able to run the job. Confusing? Here's what it's like: cron.php <?php require("some_file1.php")...

Cron jobs -- to run every 5 seconds

I want to create cron job that runs a script every 5 seconds. Seeing that cron jobs only allows increments of minutes 0-59 and so on. I thought to create another script that calls my original script written below. #!/bin/bash while true do # script in the same directory as this script. is this correct? bash makemehappy.sh sleep 1 don...

Hadoop job fails when invoked by cron

I have created the following shell script for invoking a hadoop job: #!/bin/bash /opt/hadoop/bin/hadoop jar /path/to/job.jar com.do.something <param-1> ... <param-n> & wait %1 STATUS=$? if [ $STATUS -eq 0 ] then echo "SUCCESS" | mailx -s "Status: "$STATUS -r "[email protected]" "[email protected]" exit $STATUS else echo "FAI...

Calculating cron next-run-time in PHP

I'm designing a task scheduler in my own personal framework and am trying to avoid the not-as-flexible "run every n minutes/hours/days" method that'd be easier to implement. What I'd like to do is mimic cron scheduling. I've got functions in place to split patterns and calculate the next value for the next date (day of month) currently, ...

How to write Rake task to import data to Rails app?

Goal: Using a CRON task (or other schedule event) update rails database with nightly export of data from an existing system. All data is created/updated/deleted in an existing system. The website does no directly integrate with this system, so the rails app simply needs to reflect the updates that appear in the data export. I have a .t...

Cron job in phpbb?

Hi, I have phpbb installation with some automatic scripts set up but I don't know how are they run. There's "cron" folder in root directory and there are those scripts in it. The thing is that I haven't used cron job before and I don't know how to create them. Can I set them up from cpanel? ...

Auto-Backup script for mysql in Unix

I'm a Windows user but I've been asked to write a script that runs on Linux that does automatic backup for the MySQL database. I know how to do the backup (using mysqldump) but I don't know how to write a script in Linux and how to schedule it to run daily. How can it be done ? ...

Why in PHP CLI getmypid() returns 0 as a pid?

I'm developing a long running command line script and of course I want in not to launch itself more than once. So I write a .pid file and on launch check if a process with such PID exists. The problem is on Windows it returns 0 as a PID, so I always get a process by that PID running (System Idle has PID 0). Does someone know how to fix ...

Who is the acting user for cron updates drupal when creating a triggered rule?

Who is the acting user for cron updates drupal when creating a triggered rule? What I'm referring to is the php variable available to the developer when using the custom php code option in the "add a condition" widget. Is the acting user supposed to be anyone who is logged in at the time the cron runs? Or does this have to be someone who...

how to send emails via cron job usng php mysql.

hi, i managed to send multiple emails (check here).i am stuck with sending automated emails via cron. This is what i need - while the admin send emails, i store the message, emails, event date in the database. now i am trying to set a cron job to send emails to all these ids from the table with the message i have as a reminder. i am ...

In what cases would or wouldn't you use database triggers instead of a script called by cron?

A fully normalized database with no redundant data is good "academically", but has terrible real-world performance. The first optimization is obviously a cache system. After this, for creating redundant data for performance, when or why would (or wouldn't) you use triggers over a cron task that calls a script to update the redundant dat...

Thinking Sphinx indexing succeeding on command line, but failing in Cron job.

I admit I've cobbled together a mostly working production setup on Ubuntu with Capistrano from the official docs (which seem dated and make a lot of assumptions) and various blog posts of varying outdatedness. Anyway, the last annoying hang up is that indexing works when I do it by hand (and on deploy I'm pretty sure), but doesn't work ...

Single instance of a web page

I have couple of php scripts which are called by cron. The cron job runs every 20 mins. Sometimes script finishes the job in few mins and sometimes it takes more than 20 mins. I want to prevent the race condition here. One way I have in my mind is to use the database set the flag when page is running and remove flag when the job is done...