Subversion Repositories oZimbraBackup

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 3
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
Line -... Line 2...
-
 
2
 
2
 
3
#
3
# This script will do various backups of Zimbra depending on which you choose,
4
# This script will do various backups of Zimbra depending on which you choose,
4
# most of them are cold backups except the msg backup which hot copies the 'store'
5
# most of them are cold backups except the msg backup which hot copies the 'store'
5
# folder for possible individual mail retrieval. Be sure to change the variables below
6
# folder for possible individual mail retrieval. Be sure to change the variables below
6
# to point to where you got the Zimbra folder and where you want it to be backed up to.
7
# to point to where you got the Zimbra folder and where you want it to be backed up to.
Line 20... Line 21...
20
# Bits and pieces was adopted from a script created by Daniel W. Martin, 9 Sept 2007
21
# Bits and pieces was adopted from a script created by Daniel W. Martin, 9 Sept 2007
21
# Licensed under BSDL license, see license.txt for information.
22
# Licensed under BSDL license, see license.txt for information.
22
#
23
#
23
# Developer: oSource Development(as of 2009-07-01)
24
# Developer: oSource Development(as of 2009-07-01)
24
# DevTeam: Marcus Uddenhed
25
# DevTeam: Marcus Uddenhed
25
# Version: 1.0.5
26
# Version: 1.0.6
26
# Last updated: 2012-01-02 23:15
27
# Updated: 2014-05-18 16:00
-
 
28
#
Line 27... Line 29...
27
 
29
 
28
#### Global Settings ####
30
#### Global Settings ####
29
ZimInstPath=/opt			# Installation path for Zimbra, excluding the Zimbra folder.
31
ZimInstPath=/opt			# Installation path for Zimbra, excluding the Zimbra folder.
30
ZimHome=zimbra				# The Zimbra installation folder, excluding path to folder.
32
ZimHome=zimbra				# The Zimbra installation folder, excluding path to folder.
Line 314... Line 316...
314
 
316
 
315
file_transfer() {
317
file_transfer() {
316
# Transfer with ftp
318
# Transfer with ftp
317
if [ $ZimFtpEnable == "yes" ]
319
if [ $ZimFtpEnable == "yes" ]
-
 
320
then
-
 
321
if [ "$2" = "--no-send" ]
-
 
322
then
-
 
323
  # If --no-send is set ignore sending file to off site.
-
 
324
  echo "`date "+%Y-%m-%d %H:%M:%S"` - Backup not sending backup file to external storage, --no-send is set." >> $ZimLogFile
-
 
325
  echo "Not sending backup to external storage, --no-send is set."
318
then
326
else
319
if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
327
if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
320
 then
328
 then
321
  # Send task start time to log
329
  # Send task start time to log
Line 380... Line 388...
380
  # Send task stop time to log
388
  # Send task stop time to log
381
  echo "`date "+%Y-%m-%d %H:%M:%S"` - Sending file via ftp to off-site storage done." >> $ZimLogFile
389
  echo "`date "+%Y-%m-%d %H:%M:%S"` - Sending file via ftp to off-site storage done." >> $ZimLogFile
Line 382... Line 390...
382
 
390
 
383
 fi
391
 fi
-
 
392
fi
Line 384... Line 393...
384
fi
393
fi
385
 
394
 
386
# Transfer with scp
395
# Transfer with scp
-
 
396
if [ $ZimScpEnable == "yes" ]
-
 
397
then
-
 
398
if [ "$2" = "--no-send" ]
-
 
399
then
-
 
400
  # If --no-send is set ignore sending file to off site.
-
 
401
  echo "`date "+%Y-%m-%d %H:%M:%S"` - Backup not sending backup file to external storage, --no-send is set." >> $ZimLogFile
387
if [ $ZimScpEnable == "yes" ]
402
  echo "Not sending backup to external storage, --no-send is set."
388
then
403
else
Line 389... Line 404...
389
 if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
404
 if [ $ZimLogEnable = 'yes' ] && [ $ZimLogVerbose = 'yes' ]
390
  then
405
  then
Line 437... Line 452...
437
   # Send task stop time to log
452
   # Send task stop time to log
438
   echo "`date "+%Y-%m-%d %H:%M:%S"` - Sending file via scp to off-site storage done." >> $ZimLogFile
453
   echo "`date "+%Y-%m-%d %H:%M:%S"` - Sending file via scp to off-site storage done." >> $ZimLogFile
Line 439... Line 454...
439
 
454
 
440
 fi
455
 fi
-
 
456
fi
Line 441... Line 457...
441
fi
457
fi
442
 
458
 
443
# Remove local file(s) if ZimDeleteLocalFile is set to 'yes'
459
# Remove local file(s) if ZimDeleteLocalFile is set to 'yes'
444
if [ $ZimDeleteLocalFile == "yes" ]
460
if [ $ZimDeleteLocalFile == "yes" ]