cron

Processing incoming e-mail with PHP Script

So I'm trying to figure out how to send an email to an address for example, [email protected] and instead of the e-mail going to there it would be instead sent or forwarded to a script that I create to read the contents of the email and store the contents into a database. Any suggestions on how to do it in PHP? Thanks! ...

Struts2 Cron Jobs

Using struts2, is there a way to trigger an action to occur at specified intervals? Currently I am writing action classes that perform tasks that need to run at specified intervals and curling the url at the times I need to. Is there a better way to do this than invoking an http request like this? ...

MySQL multi-server tasks fall-back mechanism

I have two web servers. Server 'A' and server 'B'. Both are exact duplicate of the other and are connected to a load-balancer for serving clients. I have a tasks (cronjob) that is executed at every hour, every day. This task is currently running only on server 'A'. The problem is that this tasks is really important and if server 'A' cra...

cron-like recurring task scheduler design

Say you want to schedule recurring tasks, such as: Send email every wednesday at 10am Create summary on the first day of every month And you want to do this for a reasonable number of users in a web app - ie. 100k users each user can decide what they want scheduled when. And you want to ensure that the scheduled items run, even if t...

How does cron internally schedule jobs?

How do "modern" cron daemons internally schedule their jobs? Some cronds used to schedule a run every so often via at. So after a crontab is written out, does crond: Parse the crontab for all future events and the sleep for the intervals? Poll an aggregated crontab database every minute to determine if the current time matches the sc...

cron that will run a ruby script every day at midnight

I heard crontab would be a good choice but how do i write this line and where do i put it on the server ...

How to get Drupal's $base_url to work on a cron job?

Hello there, How to get $base_url to show the correct url for my Drupal site when I'm running a cron job? Do I have to set the global $base_url manually for that to happen? Do I have to run the cron job as a registered user? When I run mysite.com/cron.php by hand everything seems to work fine: $base_url is set to the correct url. Ho...

How can I make contents of a txt file be used as subject for mail in linux?

Hi, I have a crontab file which executes a shell script as shown below 27 11 * * * /usr/python/bi_python/launcher/launch_script_leds.sh The shell script does a number of things: 1)executes python script launcher.py which runs tests and outputs to log files 2)sends mail notification when tests have completed with test output as body ...

How to solve this cron job error directory not found?

Hello Everyone, I have make one cron job as below <?php echo "HI"; ?> When i ran it using cron job it give me error "?php directory not found" Please help me regarding this. Thanks in advance. Kanji ...

I need to restore a database (mysql) every 30 minutes using a cron job.

I'm new to cron jobs and I need to restore a database (mysql) every 30 minutes. Is there a cron job command that can restore a database from a .sql file that's been gzipped? Or do I need to create a php script to do this and create a cron job to call this script every thirty minutes? Also, and this is a separate question but still rela...

How to stop all instances of cron?

I have a cron job that executes a rake task in rails. I noticed in the log that it was running the task 4 times everytime it was executed. The problem is that there are 4 instances of cron running. I ran: /etc/init.d/crond stop And now there are only three. Running: ps -ef | grep cron I see this: root 1029 1 0 Oct20 ?...

OS X + Crontab: How do you run SCP via cron?

This works fine when I run it by hand: #!/bin/bash eval `ssh-agent` ssh-add /usr/bin/scp me@server:~/file ./ exit 0 However, when the cron runs the file is never touched. I know the ssh keys are right - replace that scp with an ssh and it runs fine. ...

Query related to rails Cron Job

2**** cd $PROD_RAILS_ROOT && ./rake --silent users:update RAILS_ENV=production What does 2 mean here? Is it every 2 min. ...

How can I optimize my xml output so that the data transfer time be lower?

HI, I have a cron that calls a basic API URL. The output is xml so I use php's file_get_contents() to get the data to process. My question is, Does the output format of the xml make a difference in the transfer time from one server to another? The cron is running every ten minutes and I don't want the crons to overlap at some point bec...

Find cron jobs that run between given times

Is it possible to find all entries in a crontab that run between time X and time Y without having to parse the cron time entries myself? I'm mainly concerned with time hour and minute, not so much the other 3 time fields. ...

Ensure a PHP script is only ever run as a cron job?

How can I ensure a user can not run a PHP script and that it is only ever run as part of a cron job? ...

How can I make a PHP script that cannot be called by a web browser?

Possible Duplicate: PHP - how to best determine if the current invocation is from CLI or web server? I know the obvious answer is to place the script outside the web root, but I'm hesitant to do that in my project since that complicates installation and might not even be possible in some shared hosting environments. I know so...