Forum Moderators: coopster
The process I want to run through is as follows:-
(pseudo code)
Check last updated time (stored in Unix timestamp format in a file lastupdated.txt)
if current time - last updated time > 1hour (the remote server is updated about once an hour) or lastupdated.txt does not exist.
check if an updating file exists (this file is created when the next part of the script runs to make sure multiple people dont start the script off)
if yes
display updating.gif
else
check if theres an update to download on remote server (compare local status.txt with remote status.txt found at [example.com...]
if no
echo "Data last updated at (time from lastupdate.txt)"
else if yes
create updating.txt
d/l update
d/l status.txt
do data transformations
update lastupdate.txt
delete updating.txt
else if error with remote file
echo "error updating data. remote server unavailable"
echo "Data last updated at (time from lastupdate.txt)"
endif
endif
else
echo "Data last updated at (time from lastupdate.txt)"
endif
else
echo "Data last updated at (time from lastupdate.txt)"
endif
NOTE. The script section in red needs to be run as an uniterruptable script (ie closing the webpage doesnt stop the script). I'm not sure if this can be done without doing it to the whole script.
(damned indent loss:/)
[edited by: jatar_k at 3:58 pm (utc) on May 11, 2004]
[edit reason] generalized url [/edit]