Export Update Sets Via Script

JDX7913
Tera Guru

I want to write a scheduled job where it would export all "in progress" update sets at a given date and time (i.e. export update sets every Monday morning etc.).

I know where the update set table is, but what is the actually code to export or download the update sets and save it onto a computer?

Thank you.