cron

Looping a PHP Script

I've got a PHP script that checks a directory and deletes any files not modified within 15 seconds (It's for a game). My problem is how to get this script to run all the time. I set up a cron job to run every 10 minutes and then in the PHP script I have an infinite loop with a sleep(10). My thought was that it would run the code every 1...

Debug MySQLs "too many connections"

I'm trying to debug an error I got on a production server. Sometimes MySQL gives up and my web app can't connect to the database (I'm getting the "too many connections" error). The server has a few thousand visitors a day and on the night I'm running a few cron jobs which sometimes does some heavy mysql work (Looping through 50 000 rows,...

How can I schedule Ruby script execution in background?

Hello, I'm trying to run a script every minute with "SINC is not CRON". I've used the following crontab line * * * * * ruby -X D:/xampp/htdocs/maker ./do.rb and now every minute I get a new cmd window. How can I force Ruby or SINC to invoke these as background processes? ...

How is this Quartz Cron Expression executed

I have a the following; private String cronExpression = ""; private final String jobID = "MyJObID"; ... Scheduler scheduler = ServiceLocator.getInstance().getScheduler(); CronTrigger trigger = new CronTrigger(jobID , Scheduler.DEFAULT_GROUP, cronExpression); JobDetail jobDetail = new JobDetail(jobID , Scheduler.DEFAULT_GROUP, MyJob.clas...

Allowing user to configure cron

I have this bash script on the server that runs every hour, via cron. I was perfectly happy, but now the user wants to be able to configure the frequency through the web interface. I don't feel comfortable manipulating the cron configuration programmatically, but I'm not sure if the other options are any better. The way I see it, I can...

Writing a file in PHP with a cron

I am trying to write a file to a sub folder of the directory my cron script is in using file_ put_ contents. However, I keep getting a warning "failed to open stream: No such file or directory." I have this directory structure: httpdocs/scripts/fileDirectory The cron script lives in the scripts folder. I call it with the cron comm...

Proper format for a mysqldump dynamic filename in a cron?

I have a crontab set up that errors out every time I attempt to do it. It works fine in the shell. It's the format I'm using when I attempt to automatically insert the date into the filename of the database backup. Does anyone know the syntax I need to use to get cron to let me insert the date into the filename? mysqldump -hServer -uUse...

Best method to send programmed emails from web application

I want to send emails through a web app, for example, reminders of a tasks manager, reminders of birthdays... I want to program a date and an hour, and get the email sent at that moment. I think I have two options to do this: using cron or sending email with a future timestamp. Using cron involve to run a command (which will query the ...

Cron job on Ubuntu for php

I'm using Ubuntu on the server and I'm using Putty to access. I want to create cronjobs for my php site. How can I do this? ...

How do I get cron to call update my site (PHP)?

Hi, I want to update my site every 5/10 minutes using cron. I'm connecting to my server (Ubuntu) using PuTTY. I edited the crontab file but it doesn't seem to work... What should I do? ...

Need to Automate PPTP connectivity from Linux to Windows.

Hi All, I'm in need of setting up cron-based VPN connectivity from Ubuntu "Jaunty" to a Windows-based VPN over PPTP for incremental DB synchronization. Using the default Network Manager and PPTP module everything seems to work fine. However, I have 2 issues: 1) Despite checking "Use this only for resources", I still lose my local in...

best way to reindex sphinx in ubuntu hardy

Hi, I'm running a slice of ubuntu hardy. I've installed sphinx, and I would like to run the sphinx indexer every x minutes. What is the best way to go about doing this? ...

Run cronjob as a logged in user

Hi, I am currently running a php cronjob to crawl through some HTML. I have come to a scenario where I have to be logged in to access some data. How can this be achieved? The cronjob is running on a server which I dont have access to. Basically, let's just say, I am trying to access some HTML data which is only available after a use...

Cron error messages; is it my script causing the errors?

I have a cron job that ideally I want to run hourly (it's on the FB accelerators and deals with realtime social stuff, so once an hour doesn't cut it) 1) Can I have a cron job that contains "run(), sleep(60), run()..." that lasts for 60 minutes? 2) Frequency of running aside, it currently outputs: ...web/public/mysqltest.php: ?php: ca...

Processing many rss/xml feeds in a cron file without overloading server

I have a cron that for the time being runs once every 20 minutes, but ultimately will run once a minute. This cron will process potentially hundreds of functions that grab an XML file remotely, and process it and perform its tasks. Problem is, due to speed of the remote sites, this script can sometimes take a while to run. Is there a sa...

Cron to human readable string

I am using Quartz with Java to schedule jobs. One thing is that i store cron expressions on a database and i would like to present them to a user but in a more readable form. So i was wondering if there is a utility that could convert a cron expression into a human readable string. Something like : ""0 30 10-13 ? * WED,FRI" will becom...

Cron job python Google App Engine

I want to Add a scheduled task to fetch a URL via cron job using google app engine. I am continuously getting the failure. I am just fetching www.google.com. Why The url fetch is failed??? Am I missing something??? ...

Apply sed to crontab lines ?

I want to programatically change the hour which certain cron jobs execute. I'm not sure whether I'm going about this the right way, but here's the plan. Jobs which are subject to change will have a comment on the end of the line "#change-enabled". 15 5 7,14,21,28 * * /path/to/executable1 #change-enabled 15 * * * * /path/to/executable2 ...

PHP ob_* from cronjob?

Hi guys, I'm experiencing some problems with ob_* function when it runs as a cronjob: <?php function getLayout($file, $extract=array()) { if (is_file($file)) { if (count($extract) > 0) { extract($extract); } ob_start(); include $file; $contents = ob_get_contents(); ob_end_clean(); retur...

wordpress, cron & time - does time on server affects plugins? how to fix it?

I'm running wp on lamp install in virtual machine. I frequently pause it, save snapshots, etc. Date and time aren't correct because of this and i think i noticed weird behavior of plugins that use cron. How do i fix my time and plugins? Maybe i should get time from external location so it would be correct even though i regularly pause my...