cron

Suggestions/Tricks for Throttling a PHP script

I have a scheduled task that runs a script on a regular basis (every hour). This script does some heavy interaction with the database and filesystem and regularly takes several minutes to run. The problem is, the server's cpu-usage spikes while the script is running and slows down normal operations. Is there a way to throttle this proces...

Why can't my Perl script load a module when run by cron?

I have a bunch of Perl scripts that all run fine, yet need to have use Plibdata; up top. I set up a cron job that runs (I get the confirmation email from root) and it spits back the following error message: Can't locate Plibdata.pm in @INC (@INC contains: /install/lib /opt/perl58/lib/5.8.8/IA64.ARCHREV_0-thread-multi /opt/perl58/lib/5....

Google App Engine for pseudo-cronjobs?

I look for a possibility to create pseudo-cronjobs as I cannot use the real jobs on UNIX. Since Python scripts can run for an unlimited period, I thought Python would be a great solution. On Google App Engine you can set up Python scripts and it's free. So I should use the App Engine. The App Engine allows 160,000 external URL accesse...

Why does my command-line not run from cron?

I have a perl script (part of the XMLTV family of "grabbers", specifically tv_grab_oztivo). I can successfully run it like this: /sw/bin/perl /path/to/tv_grab_oztivo --output /path/to/tv.xml I use the full paths to everything to eliminate issues with the Working Directory. Permissions shouldn't be a problem. So, if I run it from the...

How to ensure that a program is running and restart it if needed ?

Hi, I developed a software (in C++) which needs to be continuously running. That basically means that it has to be restarted each time it stops. I was thinking about using cron jobs to check every minutes if it is still alive, but there might be a cleaner way or standard way of doing this. Thanks in advance ...

Cron to Log the ip of a repository with a dynamic ip

Hi, I am using a mac mini with a dynamic ip to store an SVN repository. As an unexpected change of the ip makes it difficult to consistently use the repository, I am interested in creating a cron to log the ip on another server every time it changes. What would be the best way to do this? ...

google app engine - design considerations about cron tasks

I'm developing software using the google app engine. I have some considerations about the optimal design regarding the following issue: I need to create and save snapshots of some entities at regular intervals. in the conventional relational db world, I would create db jobs which would insert new summary records. for example, a job w...

Getting started with cron jobs and PHP (Zend Framework)

I am totally new to the subject of cron jobs so I have no idea where to start learning about them; when, why, or how to use them with my Zend Framework application, or PHP in general. Can anyone explain the process, with an example, or recommend some good resources to get started? ...

Proper way to run a script using cron?

When running a script with cron, any executable called inside must have the full path. I discovered this trying to run wondershaper, when many errors showed when it tried to call tc. So my question is, what's the proper way to overcome this problem? Possible solutions: cd to the executable folder and prepare symbolic links to any othe...

scheduling capistrano function using cron

Hello, I'm a php developer using capistrano, with multistage support, to deploy my application to my production servers. Hence, I have very little ruby or rails knowledge. I've figured out enough to add a new function called 'flush' to my deploy.rb script which invokes a php script on all my production servers. The purpose of the 'flus...

PHP Errors on a cronjob, works fine at prompt.

I am running the following script on a cronjob... cd /etc/parselog/ php run_all.php >/dev/null and am getting the following errors: [05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './pdo.so' - ./pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0 [05-May-2009 20:30:1...

long time cron job via wget/curl ?

Hi All I am working on cron jobs for my php app and planning to use cron via wget/curl. Some of my php cron jobs can take 2-3 hours. How to let php work 2-3 hours from cron tab ? Is it good practice to run such long time jobs via cron wget/curl ? Anyone got experience on this ? I also have email queue and i needs to be run every 10 sec...

What are the alternatives to the Open Source Job Scheduler?

Are there any alternatives to the Open Source Job Scheduler? I'm looking for a way to gain more control over scheduled work tasks than plain cron is offering, but haven't found anything else but Quartz, which isn't language-neutral. ...

How to emulate Cron Jobs on a Windows Server?

I'm running .NET on a windows box and I would like to have a function run every night at midnight. Of course since HTTP stateless and Windows doesn't have a "cron job" type function (that I know of), I will either have to visit my site myself every night at midnight or just wait for a user to visit the site to rely on it being updated. ...

Does a cron job kill last cron execution?

Hey All, I have a cron job the executes a PHP script. The cron is setup to run every minute, this is done only for testing purposes. The PHP script it is executing is designed to convert videos uploaded to the server by users to a flash format (eg... .flv). The script executes fine when manually doing it via command line, however when e...

How Do I Backup My PostgreSQL Database with Cron?

I can run commands like vacuumdb, pg_dump, and psql just fine in a script if I preface them like so: /usr/bin/sudo -u postgres /usr/bin/pg_dump -Fc mydatabase > /opt/postgresql/prevac.gz /usr/bin/sudo -u postgres /usr/bin/vacuumdb --analyze mydatabase /usr/bin/sudo -u postgres /usr/bin/pg_dump -Fc mydatabase > /opt/postgresql/postvac.gz...

On mysqlimport, line breaks, and character encoding (I think)

First, some disclosure: I am not a Linux admin, and my Linux admin is not a programmer. That said, we have a cronjob that runs a mysqlimport command to import a text file that's generated daily. I have no control or involvement in how this file is created. Through trial and error, we discovered that the text file is generated on a Wi...

programmatic automated way to determine: is my site reachable?

Question: I need a way to automate routine tests that tell me if my website is reachable from remote addresses. Local tests and scripts from my own machines are not enough because these tests are inconclusive (return false positives). Is there a service or programming trick I can use to routinely attempt to connect to my site where the ...

A good place to read & write data used by a cron script?

Hi, I'm writing a script which is to be executed hourly. It basically works as: Read the datafile if it exists. Perform an action if the datafile has certain contents. Write over or create the datafile. I will put the script in /etc/cron.hourly/ on Ubuntu which will make it execute once each hour. What would a good place to store t...

How to create cronjob using bash

Does crontab have an argument for creating cronjobs without using the editor (crontab -e). If so, What would be the code create a cronjob from a bash script? ...