dcat127 Posted December 29, 2015 Posted December 29, 2015 I have a script that I want to run on multiple computers, this script will:Download an email of over pop3, and after processing it (which may take a minute) delete it from the server. The script will poll the pop3 server every 1 minute to check for new messages.I want to have scripts running on at least 2 different computers (at different locations) to provide: Redundancy and load balancing.It is important that each email only gets processed once.My question is, what is the best way for the scripts to check whether the other is currently downloading a message on the mail server?Is using writing information into an Mysql database on the Webserver a good choice?
water Posted December 29, 2015 Posted December 29, 2015 If both computers are on the same network you could write a lock file to a file share when a computer starts to read mails and delete it when he has finished to do so.The script then just has to check for the lock file and if it exists wait in a loop until it gets deleted. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
dcat127 Posted December 29, 2015 Author Posted December 29, 2015 Both computers are going to be on a separate network
water Posted December 29, 2015 Posted December 29, 2015 If they can't share a file on a network share then a database will be a good choice. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
argumentum Posted January 3, 2016 Posted January 3, 2016 (edited) My question is, what is the best way for the scripts to check whether the other is currently downloading a message on the mail server?Is using writing information into an Mysql database on the Webserver a good choice?The answer is .... How else would it be practical. Go for it.Now, what if the webserver is down ?How do you handle synchronizing the other scripts.I'd let them all "check mail, d/l, remove", the script that has the longer .eml is the correct one and sync based on that. Or better, once you have the same .eml by more than one script, then remove the source email, just to be safe for the redundancy.Edit: Let us know how you ended up doing it. Edited January 3, 2016 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now