cron

Is there a way in which a PHP or shell script can setup a cron job on a web server?

I am writing a component for Joomla and there is a specific task that requires an update to some stats every so often. I would like to setup a cron job to do this. The only problem is that requires the user to go and setup the cron to run the php update stats script. On installation of the component how can I automatically setup a cron ...

PHP: Require path does not work for cron job?

I have a cron job that needs to include this file: require '../includes/common.php'; however, when it is run via the cron job (and not my local testing), the relative path does not work. the cron job runs the following file (on the live server): /home/username123/public_html/cron/mycronjob.php and here's the error: Fatal error: re...

run cron on xampp

I know how to run a php script via cron of a cpanel of a live website, but I also want to learn how to do this cron thing via xampp on my localhost ?, anyone who can actually tell me the exact steps how to do it ?..my OS is win 7 ...

Code for stopping the overlapping of the Cron job.

I need to stop the overlapping of cron jobs for example:If a cron job is scheduled at morning 2 o clock for DB backup and other cron job is scheduled at morning 7 o clock for DB backup again.So i need to stop the 7 o clock scheduled cron job if the DB backup for 2 o clock is not completed. ...

PHP Cron Job: Including file not working?

i run a cron job every night, but for some reason, it is saying that the file i try to include is inexistant: Warning: require(../includes/common.php): failed to open stream: No such file or directory in /home/fini7463/public_html/cron/journeyNotifications.php on line 2 Fatal error: require(): Failed opening required '../includes/common...

File path for a Cron Job

Hi I want to run a cron job to call a php script on my server. I am using Cpanel from my web host and these are the options Minute: Hour: Day: Month: Weekday: Command: I am really strugling to point the command to my file i am using this line /home/abbeysof/public_html/adi/cron/daily.php but I am getting this error /bin/sh: /hom...

write a background process to check process is still active

In UNIX, I have a utility, say 'Test_Ex', a binary file. How can I write a job or a shell script(as a cron job) running always in the background which keeps checking if 'Test_Ex' is still running every 5 seconds(and probably hide this job). If it is running, do nothing. If not, delete a directory at the specified path. ...

Using cron + cURL to download files at night, network takes a few seconds to connect

I start a cronjob at 1:00 A.M. to use curl to check for updates on the web for some files, save needed updates to a text file, and then read the text file and download off of that. I then output the curl responce to a log file so I can see what's happening in the morning. It seems my connection doesn't start for about 4 seconds after cro...

How to run separate PHP files sequentially in a cron job?

I am setting up a cron job to run a single PHP script which will include several other PHP scripts. I'm doing it this way so that each script will only run when the previous one is finished executing. The problem is, I don't necessarily have full control over the content of all the PHP scripts included and therefore, what files are incl...

Magento: Newsletters not going out

Hello The problem i have is that i have created newsletter template, added few subscribers and i can add the template with subscribers into queue - all that works fine. I can also run the cron.php from the browser - it runs without errors, but the damn e-mails are not going out anyway. For that reason i have not done the crontab -e an...

Cygwin cron starts at wrong time

I have a cron job starting at 1 o'clock everyday 0 1 * * * somescript the script downloads updates my files, however when I check my modified date the earliest file says it was modified at 3:30 A.M. and this happened for 2 days now, so I tried */1 * * * * date >> c:/date.txt and saw that the date is fine. Is there something else th...

PHP and Cron jobs

I have some scripts which need to be run only through the CLI interface. So, when I execute them through Cron jobs, will they run through the CLI interface or some other daemon(if thats the right word to use). ...

Creating a cron job for job pool for my membership website - whats a good table design?

Hi guys I want to set up a job pool for my membership based website. Users on my website can choose to execute certain tasks that take a while to be done like sending invite emails etc. Instead of having it be run on a form submit, I was thinking of creating a table where an entry would be made for the job requested. Eg a user wishes to ...

Cron trigger to run at half past the hour every hour

Hello Can anyone suggest a way to set a Cron trigger to run at half past the hour every hour? So far, I've got one working hourly as per "0 0/60 * * * ?". Am I looking at "0 0/30 * * * ?" at all? Mr Morgan. ...

Creating a php script to run as cron job - using Zend Framework library...

Hi guys I'm creating a php script that would be called as a cron job. However I need to use the functionalities of the Zend framework. The thing is that relative referencing of files especially in includes don't work when programming for being run via command line so I'm stuck with how do I use the zend libraries here. I don't want to go...

cron job with CakePHP

Hello I have referred http://bakery.cakephp.org/articles/view/calling-controller-actions-from-cron-and-the-command-line and created cron_dispatcher.php and placed it in the app folder. I have return some test email function for the cron job to run in my users controller's test method. And i have created a Cron job in my web server's c...

Using crontab with django

I need to create a function for sending newsletters everyday from crontab. I've found two ways of doing this on the internet : First - file placed in the django project folder: #! /usr/bin/env python import sys import os from django.core.management import setup_environ import settings setup_environ(settings) from django.core.mail imp...

Starting and stopping a process daily using the shell?

I know I can start the process with cron, but how would I go about stopping it? I thought about starting a new process1 everyday at 00:00, then at 23:59 I'd start a process2 doing ps -aux | grep process1, getting the pid from the line and then killing it, but I was wondering if there's be a better way to do it. I could use Python or Jav...

run an update task without a cron job

I do not have access to cron jobs as I am on a shared server. I would still like to run an update task on my database at set intervals. How can I best achieve this. Obviously I could check the time in which index.php is executed and if it is on the hour I could include my update script. But then there is a risk of the script not executin...

Download Email Attachments via Simulataneous Cron Jobs -- Race Condition

I need a cron job to check email accounts and download certain attachments. This cron job will be running every minute. My problem is that when the first script is downloading email attachments, a second (or third or fourth ...) script will most likley be running alongside the previously executed script. The problem is that I am not sure...