A quick set of batch scripts I wrote up (two of the three scripts, anyway) for dumping all of my (specified) MySQL databases into an archive for backup. The log mailing (emailsql.pl)requires Perl and the MIME:Lite module to correctly function. I’ve also utilized a wrapper script so the log outputs to a separate file [to be mailed]. There’s also a ‘dummy’ log file I use in my crontab file, though this isn’t really necessary:
Coding
If only everything was as easy & straight-forward as account provisioning in Zimbra: [shell]!/usr/bin/perl
ZCS IMPORT SCRIPT
Provided by : ZCS Wiki
Modified by : J.R.
Last Change : 2008.04.09
#
Lookup the valid COS (Class of Service) ID in the interface or like this
my $cosid = su – zimbra -c ‘zmprov gc apd |grep zimbraId:’
;
$cosid =~ s/zimbraId:\s|\s$//g;
while (<>) {
chomp;