Script for sending welcome message in background

Another question here. Does anyone have any idea how to keep track of where the script is in the process? For example we send 10k emails and stop. Then want to start again, how would we know which record to start with?