Hi marcmac,
Thank-you very much for your comments and help.
I haven't run it yet. But, will do so today and make the corrections as pointed by you.
Code:
There's no error checking at all. None. NONE.
Will take care in v0.02
Code:
There's no enforcement of the user (you need to run this as zimbra).
I am deliberately not enforcing the "zimbra" user because once I improve on this, I want to be able to run it as any user and am planning to setuid-setgid root and have a web interface ... (that's why I am using absolute paths for zimbra's provided binaries).
Code:
There's no usage statement, so ./script.pl --help will kick off a backup (I get flamed for that one constantly)
Thanks again, marcmac. v0.02
Code:
Don't call mysql, use the perl DBI - it's even shipped with zimbra.
I am using "mysqldump" and don't know if I can use DBI for similar purpose. But if it can be, then I will make the changes.
Code:
You should use the zmmailbox command to list the calendars, and grab them all.
That looks like a perfect command. Didn't know about it. Will use it.
Code:
I don't think you need to specify BOTH the port and the socket for mysqldump.
I am specifying both because I am using the mysqldump binary that is not bundled with Zimbra. This binary would generally be compiled alongwith a mysql-server that would use the default port and default socket. If I only provide port it fails because it tries to search in the default path for the socket. It works only when I provide, both, port and socket.
Sincerely,