I assume you're generating the clone in the pre-script as well?
Depending on what you're doing in the script currently, it may be easier to simply allow snapdir access on the SQL client and make the comparison against that.
Can you provide a bit more context about what is occurring in the scripting process, that may help with providing a solution.