TJ: separated upload to a script so it can be used to test meresco-lucene server.
TJ/HM: print pid.