While I'm a bit suspect of this entire script/approach I believe the problem plaguing you at the moment is that your find command is not finding any files and thus your attempt to execute pg_archivecleanup only occurs with a single argument - which is an error.
For something this important I would advise considerably more debugging output and explicit error handling. Don't rely on set -e
On a related note - I don't understand why you'd use the "exec" command here...