cron

How to determine if a PHP file is loaded via cron/command line

I need to determine whether the PHP file is being loaded via cron or command line within the code. How can I do this? ...

run cronjobs and send to email problems

Hey I want to create cronjobs that runs every 10 min < time now and mail me a email with the follow txt. "deleted orders" my code looks like this. MAILTO=”[email protected]” */10 * * * * /var/www/php-sites/dlf/cron_jobs.php I have checked my mails the last 30 min.. and still havent receive any mails. am i doing it wrong ? ...

Manual run works, but not cron

Hi, Have a problem with a php script to get the title of a URL. It works when I run it manually, but not when I run it through cron. Googled to get a small script to get the title of a URL: function getTitle($url) { $fh = fopen($url, "r"); $str = fread($fh, 7500); fclose($fh); $str2 = strtolower($str); $start = str...

Render in infinity loop

Question for Python 2.6 I would like to create an simple web application which in specified time interval will run a script that modifies the data (in database). My problem is code for infinity loop or some other method to achieve this goal. The script should be run only once by the user. Next iterations should run automatically, even w...

Running background processes after a web request

I'm interested in kicking off processes after a web request, or possibly forking a new process after the initial thread is finished. I would prefer not to use a cron, because of the nature of the the jobs I'll be running and how often they need to be run, waiting a minute to refresh is not an option. I'm considering a few ways of doing...

how to redirect complete output of a script

I have a simple cronjob running every day at 18:35: 05 18 * * * ~/job.sh 2>&1 >> ~/job.log So the output of ~/job.sh should be written into ~/job.log. In job.sh, there are some echo commands and a few python scripts are executed, e.g.: echo 'doing xyz' python doXYZ.py Now, whatever output the python scripts produce, they are not wr...

Bash script and cron anomaly

Hi all, I have a bash script that I am run to check to see if one of my programs has hung, and if it has kill it. The script works fine if ran from the command line, but if I schedule it with cron it does something very strange. Basically the script (below) gets the PID of my program and gets its created date/time from its entry in the ...

How to force fragment cache on rails from cron schedule?

Is there any way I can trigger a page to be fragment cached without having someone to load the page the first time? I am planning to use cron schedule, this is because my cron scheduler updates the database and that's when I want to force the fragment cache to happen. Thanks. ...

Cron Jobs in a Zend Framework 1.8+ application?

I am using Zend Framework 1.9.6. I want to start using cron jobs. I am new to this so I'm not quite sure how to do this. I'm thinking it would be a good idea to store my crons in /myapp/scripts or /myapp/application/cronjobs. What do you think? (my application only has a default module) Once I've decided on a place to store them, how w...

Crontab doesn't run Wget with a url with parameters

Hi, I'm using Aptana Cloud without root access. WORKS: * * * * * /usr/sfw/bin/wget -qO- 'http://myproject.aptanacloud.com/myproject/myphp.php' | /bin/mail [email protected] DOESN'T WORK!: * * * * * /usr/sfw/bin/wget -qO- 'http://myproject.aptanacloud.com/myproject/myphp.php?param1=blog%2frss2.xml' | /bin/mail [email protected] I...

Curl Error 52 Empty reply from server

Hello I have a cron job setup on one server to run a backup script in PHP that is hosted on another server. The command I've been using is formatted like this: curl -sS http://www.example.com/backup.php Lately I've been getting this error when the Cron runs curl: (52) Empty reply from server I have no idea what this means. If I ...

Facebook status update with PHP and Cron

Is it possible to use facebook php api and crontab to create status updates? Crontab would run the php code that sends the status update to facebook. The problem for me is the login part [$facebook->require_login();]. Crontab can't login, so can i send the login information (username and password) to facebook as well? my example code:...

How can I defer processing during apache / mod_perl page rendering?

I have an apache2 / mod_perl website. On one page, I need to do some server/server communication via SOAP. The results of this communication are not required for the rendering of the page (but user input is required to trigger this communication). The SOAP communication is very slow. So what I want to do is process and print the page ...

Using Google App Engine's Cron service to extract data from a URL

Hi Guys! I need to scrape a simple webpage which has the following text: Value=29 Time=128769 The values change frequently. I want to extract the Value (29 in this case) and store it in a database. I want to scrape this page every 6 hours. I am not interested in displaying the value anywhere, I just am interested in the cron. Hope I ...

Database structure question...Emails scheduled for delivery?

I am trying to implement a system where emails to large (or small) groups of people are scheduled to be delivered by a cron job (instead of in a loop, while the user is waiting for them to finish sending). There are two types of email a user could send: an email to everyone in the subscribers table, or an email only to members of a grou...

How to setup cron job?

Hi, I have a windows shared hosting account with Godaddy.com with PHP5 that does not allow cron or scheduled job. I am developing a website in PHP5 with CakePHP and I need to run a cron job to send emails. What will be the best way to do it? Thanks for your answers in advance. :) ...

call php script every minute

Hey, I want to call a php script every minute. My scriptruntime on my webserver is about 90 sec. I thought doing it with cronjobs but i have to pay for that service. Is there an other possibility? Thanks a lot. ...

cronjob googleAppEngine run script?

Hey guys, I've setup a GAE cronjob. My cron.yaml looks like this cron: - description: checkForPush url: /cron/ schedule: every 1 minutes Inside the cron folder i've got a cron.py file with an URL-Fetch. If i deploy the project and the cronjob runs it fails. Any ideas? Thanks a lot. ...

Run a list of bash scripts consecutively

I have a load of bash scripts that backup different directories to different locations. I want each one to run every day. However, I want to make they don't run simultaneously. I've wrote a script that basically just calls each script in succession and sits in cron.daily, but I want a way for this script to work even if I add and remove...

How do I check the exit code of a command executed by flock?

Greetings all. I'm setting up a cron job to execute a bash script, and I'm worried that the next one may start before the previous one ends. A little googling reveals that a popular way to address this is the flock command, used in the following manner: flock -n lockfile myscript.sh if [ $? -eq 1 ]; then echo "Previous script is s...