It would be useful if the export API supported two features:
- a request for the number of records in the data
- an option to export starting from a given record number
Then it would be possible to have a shell script check the received data and retry until it had retrieved all the records.