Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: bill
Im running and internet radio station. There is a currentsong.txt file that is generated after each track change.
Right now I have a dos command that uploads the file every 1 minute, however I need it to upload more oftne then that. Is there a way to make a dos command loop over and over or is there a way to monitor the file for changers and then upload it when it changes? If anything the looping dos command would work (although several unessary uploads) or a program that fires off that dos command every 10 or 15 seconds would be great. Thanks!
zararadio seems to be able to load and execute .bat files however they for whatever reason do not seem to work...
so again, is there any way to schedule a system command every 10-15 seconds or loop a dos command, possibly w/ a slight delay in the dos command?
I can't find how to do that so here is a quick solution based on if the file exists.
1. wait 15 seconds
2. check if file exists
3. If yes ftp the file and then move the file (rename to something else)
4. goto 1
The main problem here now is the wait 15 seconds bit as there is no direct command in XP / DOS to do this. You will either have to:
download Windows Server 2003 Resource Kit tools (30Mb download just for one tiny app)
use a third party utils suite (may not be free)
Try a hack using ping. For this example I'll use the ping hack.
PING -n 16 127.0.0.1>nul
if exist c:\pathtofile\currentsong.txt goto file_updated
*ftp -b .... your ftp line here
move /Y c:\pathtofile\currentsong.txt c:\pathtofile\lastsong.txt
BTW, I would recommend downloading psftp from putty. This is a secure ftp which has better ftp batch processing commands. You would need to ensure that your server accepts ssh ports first.