I need to write a script that will send data to two different servers in a round robin style. I’m not sure what method I should take and wanted some other opions.
I could write it so that it queries a file that will either have a 1 or a 0 string in it.
And if it has a 1 then send the data to server “A” and writes a 0 in the file replacing the 1 that I’m using to query.
Then the next time the process sees it has data to send it would query the file and see that it has a 0 string and sends the data file to server “B” and then write a 1 in the file that it queries and so on.
Any ideas?
I could write it so that it queries a file that will either have a 1 or a 0 string in it.
And if it has a 1 then send the data to server “A” and writes a 0 in the file replacing the 1 that I’m using to query.
Then the next time the process sees it has data to send it would query the file and see that it has a 0 string and sends the data file to server “B” and then write a 1 in the file that it queries and so on.
Any ideas?