Topic: Help Help! Need to remake registered task script to download emaisl from imap server to mysql db (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: you tell me |
posted 02-14-2009 14:04
Help guys! My old idea of using a php page that downloads emails from the online imap server into our db and refreshes constantly is clumsy and backfires every now and then. I need to remake this stupid script again. I tried making a bat file which would call iexplorer to open the download script but for some damn reason the bat file isn't called periodically and teh stupid scheduled task thing just skips calling it now and then. |
Paranoid (IV) Inmate From: Florida |
posted 02-14-2009 19:19
Sorry, what do you need these email addresses for? |
Bipolar (III) Inmate From: you tell me |
posted 02-14-2009 19:51
Not email addresses - let me rephrase what I was saying. We have an imap server - we have a php script that connects to the imap server and downloads all emails - note emails not email addresses - emails belonging to one address in a mailbox and serializes the contents as objects and enters them in a database. Well the script works fine but the thing is that we nee dto fix up a fool proof method to run this script on a periodic basis. We tried making a batch file and opening IE from that file calling the script within it. However for some reason the scheduled task dies out on us for some reason. |
Paranoid (IV) Inmate From: cell 3736 |
posted 02-14-2009 21:39 |
Maniac (V) Inmate From: there...no..there..... |
posted 02-14-2009 22:58
I asked you a couple of questions the last time and they went unanswered. Let me ask again. |
Bipolar (III) Inmate From: you tell me |
posted 02-15-2009 06:09
Hmm must have skipped my mind - sorry bout that. Well the code is kinda like this below - I have a vbs file and a bat file which calls the vbs file: code: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = 'iexplore.exe'") isbusy = 0 IE = false Set oShApp = CreateObject("Shell.Application") For Each oWin In oShApp.Windows t = TypeName(oWin.Document) On Error Resume Next IE = 1 Err.Clear If t = "HTMLDocument" Then Set IE = oWin Exit For End If Next if IE <> false then if IE.busy then isbusy = 1 end if end if if isbusy = 0 then For Each objProcess in colProcessList objProcess.Terminate() Next Set WshShell = WScript.CreateObject("WScript.Shell") Return = WshShell.Run("iexplore.exe http://localhost/modules/download.php", 1) end if
code: start closeIE.vbs cls exit
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 02-15-2009 10:41
chances are it's still running and that's why the task schedulder doesn't start it again... |
Bipolar (III) Inmate From: you tell me |
posted 02-15-2009 11:45
Hmm well I'm thinking of trying to get rid of use for IE for this - using IE was just a monkey wrench solution until we figured something concrete - seems it didnt last as long as we were hoping. Need to then fix up my download script to be run from command line then - however is there anything I need to change in coding in order to run it successfully on teh command prompt. |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 02-15-2009 19:11
you have long ago worn out my glass ball, parity. |
Maniac (V) Inmate From: there...no..there..... |
posted 02-15-2009 19:14
look at the log for the task scheduler for errors. |
Bipolar (III) Inmate From: you tell me |
posted 02-15-2009 20:06
Well what kind of further information should I post btw I really need help here - and am willing to tell what ever else is needed |
Maniac (V) Inmate From: there...no..there..... |
posted 02-15-2009 20:11
quote:
|
Paranoid (IV) Inmate From: cell 3736 |
posted 02-15-2009 21:45
parity did you try wget? |
Bipolar (III) Inmate From: you tell me |
posted 02-16-2009 06:55
Great lemme try these out - sorry I did check the early post - didn't try it out though - would give what all you guys have given a shot and will let u know in a while.... |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 02-16-2009 11:25
How about the bloody actual error messages you get when running your script on the command line? |
Maniac (V) Inmate From: there...no..there..... |
posted 02-16-2009 14:12
quote:
|
Bipolar (III) Inmate From: you tell me |
posted 02-16-2009 14:26
Ok I fixed it YIPPEEEE - I guess its kinda late to give the error messages but the errors were all fatal include could not find path errors. Primarily because I was including using relative paths. The issue being that the bat file which calls the script is in a different folder than the script itself was leading to issues. Had it resolved by changing the relative paths includes to referring to paths using dirname(dirname(__FILE)) as Tyberius said. |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 02-16-2009 15:25
cron jobs are usually available when you rent dedicated hosting... how new are you in this business, actually? |
Bipolar (III) Inmate From: you tell me |
posted 02-17-2009 06:55
Umm well I've been developing for over 5 years - however I'll be honest with you - I havent registered a simgle domain or web host so far and this practically is gonna be my first . I just did the programming and tested it on local host and the most I'd do was make sure it was working online. |