We need a routine that does
<path> is a var
select dbname from databases
backup db to <path>dbname
trap error and notify via console output, then try a second time.
try/catch around everything for notifying on errors.
If you have questions post in PMB, we're looking to deal with someone who understands this request with very few further questions.