cron

Can scp be used non-interactively in cron without generating keys?

Hi folks, I have a nightly database backup which I would like to scp to a remote server. As near as I can tell scp cannot be invoked with a password in the command and instead you need to set up keys for the servers? Per this http://www.spaceprogram.com/knowledge/cron_scp.html The remote box owner does not want me to set up the keys ...

Linux cronjob doesn't work (execute script)

I created a cronjob with the command crontab -e: */1 * * * * /var/lib/tomcat/webapps/ROOT/WEB-INF/scripts/test.sh This file test.sh should be executed every minute. But it doesn't work. If I run the script manually it works fine. So I think the problem is the cronjob not the script ;) Are there any permissions or something else w...

how do i set up cron jobs with rails?

Hi, I have to implement a fairly database intensive task periodically. I am using rails for the application to which this task is related and thus for the sake of easiness and uniqueness in approach I want to know how can I best implement cron job with rails. I am aware that rake is one solution, but am totally unaware of how to use it....

mysql_fetch_object(): supplied argument is not a valid MySQL result resource

I'm trying to set a simple cron script to do some database updating, and I'm pretty worthless with MySQL without ActiveRecord (I use CodeIgniter). I keep getting the error message, mysql_fetch_object(): supplied argument is not a valid MySQL result resource with the following code: mysql_connect("localhost", "user", "pass") or die(...

How to implement cron in code (php)?

May be it's a stupid question, but i didn't find unswer. I use a web-hosting startlogic.com. i asked employee about cron. They told me that they only have a feature in the control panel called "Schedule jobs" where i can manually put job. But i need to do this from my web-application. For example, when i push button, i will receive a em...

Is there a time limit to Cron jobs in Google Apps?

I have created a cron job to scan rss/atom feeds but want to know if there is a timeout on this. The documentation says that requests are limited to 30 seconds; is a cron job a regular request that is subject to this restriction? Should I break the job up into one scan per cron job just to be on the safe side, or is there a better way?...

Favorite Google App Engines Tips and Features

When starting with any new major library or system, I go to StackOverflow for the "What should I know?" questions. The answers might be subjective, but the advice usually saves me many hours of trouble. So far, I have burned a number of hours on Google App Engine tripping over the same issues that more experienced developers here alrea...

Is there a java class for constructing a cron expression using a date?

I need to build a cron expression based on user input from a form. So I have a datepicker and a select box to choose the frequency. I can build a cron expression from this easily enough, but it feels like I am reinventing the wheel. Is there a suitable class to do this for me? Something with a method like public String cron(String frequ...

PHP Cronjob with CPanel

Hello! I've never set a Cronjob before. Is it enough to just write the php file I want to execute (in this case send a mail every 24h) and follow through the CPanel GUI prompts? Thanks! ...

How do i have a cron run and check which crons are currently running

I have an ubuntu server that i have some scripts that need to run on a cron. The first is a shells script and the second is a php script. How do I check to see what is running currently on cron and how do I add these two files to run on cron daily or hourly. Not sure what the client needs yet. Is there a file i need to change. Any help w...

How to simulate a cron job

I want to run a script once day (and only on weekends), however, I cannot use cron job for that. I was thinking about having an infinite while loop, sleep for 24 hours, check if it is a weekend, and if so execute the script. What it's a good solution under bash on linux? my current implementation: #! /bin/bash while [ true ]; do ...

How to make Ruby run some task every 10 minutes?

I would like to do a cron job every 10 minutes, but my system only does 1 hour. So I'm looking for a method to do this. I've seen Timer and sleep but I'm not sure how to do this or even better yet a resource for achieving this. ...

PHP: A good script to clear temporary file for cron?

I have a temporary folder generated by my business application and wish for the documents within to be only available for around 30 minutes. I was tempted to build an index to keep track of when each file was created but that would be a little silly for just temporary files, they are not of too much importance but I would like them to re...

clear phpThumb cache regularly with cron job

Hi there, I am using phpThumb on a client website, and as it is a very image heavy application the cache gets huge quick. Today the thumbs stopped working and I had rename the cache folder, as the folder was too big to delete via ftp. I renamed it cache_old and am trying to delete it now via ssh. I recreated the cache folder and ever...

How to Speed up PHP Mail ? (using CRON)

Hi, I'm using PHP 5 and creating Mail commands to send information. My Linux (Shared) Host (www.KoreDomains.com) is sending the E-mails approximately on an hourly basis. What would be a good CRON command / set of commands to speed up the process (say E-mail what is in the queue every 5 minutes) ? The goal is to make it so the E-mai...

shell script (running via cron) to enter password when prompted

Hi, I have a daily cron task which automatically unrars a rar file and processes it's contents, however, the contents are now password protected so i'm wondering if there's a reliable way to echo the password when prompted? The password prompt comes from the UNRAR program i've installed, running on CentOS. Thanks for any help! ...

How can I stop crontab from messing up this simple BASH script (and why is it happening)?

I have a strange issue, relating to running a BASH script via cron (invoked via crontab -e). Here is the script: #!/bin/bash SIG1="$(iwconfig wlan0 | awk '/Quality=/ { print $2} ' | cut -c 9-10)" SIG2="$(iwconfig wlan0 | awk '/Quality=/ { print $2} ' | cut -c 12-13)" echo "$SIG1:$SIG2" >> test.txt exit When run from the commandline...

What's the difference between 'Day' and 'Weekday' in launchd StartCalendarInterval?

I'm working with launchd to run some automated tasks, and I was wondering what the difference is between 'Day' and 'Weekday'. According to http://discussions.apple.com/thread.jspa?threadID=1361809 there is a 'subtle' difference that can cause launchd to misbehave. Ultimately, I'd like to have a plist that runs every weekday (Mon - Fri...

Running a PHP script every 5 minutes and avoiding race conditions

Hi, I have a php script that needs to run once every 5 minutes. Currently I'm using a cron job to run it (and it works great) but my host only allows a minimum time of 15 minutes. So my question is, can I use visitors to trigger the running of a php script every 5 minutes. I can easily just record the last time it ran, and re-run it ba...

Why this expect script gives an error when it's run by cron?

I can run this expect script just fine using root or my own user account, however when I run it with cron, I always get an error. The OS is Ubuntu 8.04. Error email is as follows, Date: Thu, 26 Aug 2010 11:50:01 -0400 From: root@supa (Cron Daemon) To: root@supa Subject: Cron <root@supa> /home/myusername/bin/uploadmyip myserver.com can...