comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: running IDL as a 'sleeping' process
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: running IDL as a 'sleeping' process [message #78885 is a reply to message #78880] Tue, 03 January 2012 14:20 Go to previous messageGo to previous message
Vincent Sarago is currently offline  Vincent Sarago
Messages: 34
Registered: September 2011
Member
As bstecklu said, the best way to do a scheduling task is to combine a cron (unix) + a script calling the IDL procedure

here is an example of script :


#!/bin/sh
#set -x

#Working Directory
DIR=~/

# IDL directory
IDL="/opt/idl8/idl/bin/idl80"

LOCK=$DIR/.tasklock

# Function to delete the lock file
clean() {
rm -f ${lock}
}

# cette fonction verifie si les 5 fichiers sont arrivé et lance IDL
dowork () {

FILE=$1

#Start IDL and run program
$IDL -32 -quiet -queue 2>> $DIR/log.txt <<here
restore, '../../directory/project.sav'
spawn, 'echo $file', input
procedure, input
exit
here

}

#when end of script, call clean()
trap clean 0

# if lock found ...
if [ -f ${lock} ]; then
# ... if process is still running ...
if [ -d /proc/`cat ${lock}` ]; then
exit 0
fi
fi

# writing process number in the lock file
echo -n $$ > "$lock"

FIND=$(find $DIR -maxdepth 1 -name 'file.tmp')

echo "$FIND" | while read file; do
[ -z "$file" ] && continue
dowork $input
done


# delete lock file
clean



vincent
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: X11<->IDL Death Grip Mac OSX
Next Topic: Object SetProperty Not inherited

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 11:07:30 PDT 2025

Total time taken to generate the page: 1.12074 seconds