cron

Cron bash script leaves cron [defunct] lingering..

Hi! I'm running the below script with cron, in /etc/cron.d/mycron I have the following: */10 * * * * MyUserThatNeedsToRunTheScript /backup/sshconnect.sh However, looking at ps -aux I find that a few [defunct] processes are lingering, any ideas? Does this have to with SSH being run with -f ? 5 0 1598 641 20 0 2552 1068 p...

debian cron bug or missing something?

I'm configuring a server in N.Virginia to have the same cron schedule as our 'old' server with America/Chicago timezone. I've edited /etc/timezone to have the value America/Chicago. I have the environment variable TZ=/usr/share/zoneinfo/US/Central . I've basically matched the old server, and both are on the NTP network. The cron schedul...

Can a bash script tell if it's being run via cron?

Hello all, Not having much luck Googling this question and I thought about posting it on SF, but it actually seems like a development question. If not, please feel free to migrate. So, I have a script that runs via cron every morning at about 3 am. I also run the same scripts manually sometimes. The problem is that every time I run my ...

How to test a cron job in Local Server like WAMP?

How to test a cron job in Local Server like WAMP? ...

How does Cron affect the Getopt::Long module?

I've written a wrapper program for mailx using perl that allows me to easily add attachments and do some other nifty things that were a little frustrating to accomplish with mailx. In the first few lines I have: use strict; use warnings; use Getopt::Long; my ( $to, $from, $subject, $attachments, $body, $file ) = (undef) x 7; GetOptio...

rubyon rails, rake, crontab and encoding

I have a rails rake task which runs just fine. I want this task to be run periodically by crontab so I added it to crontab as follows : 0,30,0 * * * * cd /var/www/html/metajorn && RAILS_ENV=production /usr/local/bin/rake myraketask --trace >> /var/www/html/metajorn/log/cron_log.log 2>&1 In cron_log.log I'm seeing the following error...

cron : how to schedule to run first Sunday of every month

Hi I need to schedule a cron job to run at at 9:00 AM on first Sunday of every month. Did a little research and see that there is no short hand in cron to this. Do you know of an optimal way ? Using Bash+RHL ...

Perl module for scheduled jobs - bit like cron

I started to write a module for scheduling perl jobs with more readable syntax than a cron job, but wondered if there was already one available. I'm after something that can be run from a perl script, not a crontab file. This syntax has got to be easily readable. For example :- every Monday morning every other Tuesday at 3:30pm every ...

PHP Auction Expiry Tracking

What is the best way to send e-mails or perform functions on a small, non-real money auction script? This script is a learning exercise for me and I was wondering what the best way would be to process actions when the auction has expired. A cron job every minute seems - to me - a method which can easily be surpassed. ...

Using Cron with Cake Console on Ubuntu

I need this cron job to execute my shell just as it does when I run it on the command line. I read through the one other question I found about this, but my console-based cron job still is not working. I want to post some code and what it outputs, maybe someone can tell me what's going on. First off, this is on Cake 1.3. I am running o...

Schedule php script in xampp

I am using xampp on windows vista. I want to run a php script once every x minutes. Is there anyway in xampp that can help facilitate this?, or is using the windows task scheduler the only way. ...

Cron expression for a time range

Hi, I am using Quartz .Net to schedule my jobs in my application. I was just wondering if a CRON expression for the following scenario can be built : Everysecond between 2:15AM and 5:20AM Could someone please throw some light on this? Thanks, Ram ...

Cron and virtualenv

I am trying to run a Django management command from cron. I am using virtualenv to keep my project sandboxed. I have seen examples here and elsewhere that show running management commands from within virtualenv's like: 0 3 * * * source /home/user/project/env/bin/activate && /home/user/project/manage.py command arg However, even thoug...

How do I check for the first saturday of the month in PHP?

I need to make a simple if statement for a daily cron job to check if today is the first saturday of the month. How would I modify the following code to do that instead of just running on the 1st of every month? if (date("j") == 1) { // run cron here } ...

Browser-based MMO best-practice

I am developing an online browser game, based on google maps, with Django backend, and I am getting close to the point where I need to make a decision on how to implement the (backend) timed events - i.e. NPC possession quantity raising (e.g. city population should grow based on some variables - city size, application speed). The possib...

Cron job in cPanel to Delete Emails after 21 days

I'm having some issues with a cron job to delete emails after 21 days. I've read through many examples and have tried many different variations of this command but I can't get it to work: find /home/cont/mail///cur -name "*" -mtime +21 -exec rm {} \; Currently this runs and I get a message back from every mail box that doesn't have any...

How to wait for a task to complete before continuing shell script

I have two shell scripts to write that will be executed nightly via cron schedule. On my production server: mysqldump -ufoo -pbar --opt --routines db > ~/sqldump/{$todays_date}.sql ln -s ~/sqldump/{$todays_date}.sql latest.sql On my development server: scp [email protected]:~/sqldump/latest.sql ~/sqldump mysql -ufoo -pbar db < latest...

Cron Job with R and MSSQL

This is probably going to be an underspecified question, as I'm not looking for a specific fix: I want to run a machine learning algorithm on some data in a MSSQL database. I'd like to use R to do the calculations -- which would involve using R to connect to the database, process the data, and write a table of results back to the datab...

php time_sleep_until() and "Mysql server has gone away"

hello! i have script which must execute after every n minutes. n minutes is dynamic so that i could not set a cron job to call the script (at a specific time). so what i did was i stored the time after every n minutes in an array so that when the script is executed, it will first check whether the current time is in the array. if it i...

Syntax error only when command is run from cron

Hi folks, This command: /usr/bin/mysqldump --add-drop-table -u myuser -pmypass mydb > "/home/myuser/dbBackups/"`date +%Y%m%d`".sql" works fine from the command line but whenb cron runs it I get /bin/sh: -c: line 0: unexpected EOF while looking for matching ``' /bin/sh: -c: line 1: syntax error: unexpected end of file The command i...