I need to do steps every night in crontab job:

1. read (and store in scripts variable) info about all shared folders for specified distribution list (let call it: dl@domain.com), for which accounts it is shared;

2. delete dl@domain.com

3. recreate dl@domain.com

4. restore folders sharing for dl@domain.com

I know only how to do 2. and 3. steps:
2. zmprov ddl dl@domain.com
3. zmprov cdl dl@domain.com

But which