Skip to content

Commit 994e98b

Browse files
committed
v10b
1 parent 6716c3a commit 994e98b

File tree

4 files changed

+60
-12
lines changed

4 files changed

+60
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# xenbackup / xen-host-allbackup
22
XEN / LVM Host Auto-Snapshot-Backup for Xen DomUs (live and online)
3-
(version 1.0a)
3+
(version 1.0b)
44

55

66
It could be used to snapshot backup any kind of Xen DomU LVM volumes (Linux, FreeBSD, NetBSD and windows) and should work on products like Citrix XenServer (untested) too.

etc/backup-manager.conf

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export BM_REPOSITORY_CHMOD="770"
4040
export BM_ARCHIVE_CHMOD="660"
4141

4242
# Number of days we have to keep an archive (Time To Live)
43-
export BM_ARCHIVE_TTL="7"
43+
export BM_ARCHIVE_TTL="5"
4444

4545
# At which frequency will you build your archives?
4646
# You can choose either "daily" or "hourly".
@@ -60,7 +60,7 @@ export BM_ARCHIVE_PURGEDUPS="true"
6060
export BM_ARCHIVE_PREFIX="xen2"
6161

6262
# Should we purge only archives built with $BM_ARCHIVE_PREFIX
63-
export BM_ARCHIVE_STRICTPURGE="false"
63+
export BM_ARCHIVE_STRICTPURGE="true"
6464

6565
# You may want to nice the commands run for archive-creation
6666
# (Recommanded for desktop users.)
@@ -114,9 +114,9 @@ export BM_TARBALL_NAMEFORMAT="long"
114114

115115
# Type of archives
116116
# Available types are:
117-
# tar, tar.gz, tar.bz2, tar.lz, dar, zip.
117+
# tar, tar.gz, tar.bz2, tar.xz, tar.lzma, dar, zip.
118118
# Make sure to satisfy the appropriate dependencies
119-
# (bzip2, dar, lzma, ...).
119+
# (bzip2, dar, xz, lzma, ...).
120120
export BM_TARBALL_FILETYPE="tar.gz"
121121

122122
# You can choose to build archives remotely over SSH.
@@ -225,6 +225,12 @@ export BM_MYSQL_FILETYPE="bzip2"
225225
# command line.)
226226
export BM_MYSQL_EXTRA_OPTIONS=""
227227

228+
# Make separate backups of each database?
229+
export BM_MYSQL_SEPARATELY="true"
230+
231+
# Specify DBs to exclude here (separated by space)
232+
export BM_MYSQL_DBEXCLUDE=""
233+
228234
##############################################################
229235
# Backup method: PostgreSQL
230236
#############################################################
@@ -329,14 +335,28 @@ export BM_PIPE_COMPRESS
329335

330336
# If you don't want to use any upload method (you don't want to
331337
# upload files to remote hosts) then choose "none"
332-
export BM_UPLOAD_METHOD="none"
338+
export BM_UPLOAD_METHOD=""
333339

334340
# where to upload (global to all methods. Not required to be set for S3)
335341
export BM_UPLOAD_HOSTS=""
336342

337343
# Where to put archives on the remote hosts (global)
338344
export BM_UPLOAD_DESTINATION=""
339345

346+
# Uncomment the 'export ...' line below to activate the uploaded archives
347+
# database.
348+
# Using the database will avoid extraneous uploads to remote hosts in the
349+
# case of running more than one backup-manager jobs per day (such as when
350+
# you are using different configuration files for different parts of your
351+
# filesystem).
352+
# Note that when you upload to multiple hosts, a single succesfull upload
353+
# will mark the archive as uploaded. Thus upload errors to specific hosts
354+
# will have to be resolved manually.
355+
# You can specify any filename, but it is recommended to keep the database
356+
# inside the archive repository. The variable's value has been preset to
357+
# that.
358+
#export BM_UPLOADED_ARCHIVES=${BM_REPOSITORY_ROOT}/${BM_ARCHIVE_PREFIX}-uploaded.list
359+
340360
##############################################################
341361
# The SSH method
342362
#############################################################
@@ -389,6 +409,11 @@ export BM_UPLOAD_FTP_SECURE="false"
389409
# This is mandatory for NATed/firewalled environments
390410
export BM_UPLOAD_FTP_PASSIVE="true"
391411

412+
# Timeout (in seconds) for FTP transfer
413+
# This setting only has effect when using FTP transfer with
414+
# secure mode disabled (BM_UPLOAD_FTP_SECURE to "false")
415+
export BM_UPLOAD_FTP_TIMEOUT="120"
416+
392417
# Test the FTP connection before starting archives upload.
393418
# This will enable BM to try sending a 2MB test file before
394419
# sending any archive
@@ -434,6 +459,11 @@ export BM_UPLOAD_S3_SECRET_KEY=""
434459
# purge archives on remote hosts before uploading?
435460
export BM_UPLOAD_S3_PURGE="false"
436461

462+
# You can specify a time to live for archives uploaded to S3
463+
# This can let you use different ttl's locally and remotely
464+
# By default, BM_ARCHIVE_TTL will be used.
465+
export BM_UPLOAD_S3_TTL=""
466+
437467
##############################################################
438468
# The RSYNC method
439469
#############################################################
@@ -454,6 +484,21 @@ export BM_UPLOAD_RSYNC_HOSTS=""
454484
# enter true or false (true can lead to huge archives, be careful).
455485
export BM_UPLOAD_RSYNC_DUMPSYMLINKS="false"
456486

487+
# Files/folders to exclude when rsyncing. Warning: rsync will interpret
488+
# it as a mask, so will exclude any file/folder corresponding to it
489+
export BM_UPLOAD_RSYNC_BLACKLIST=""
490+
491+
# Extra options to append to rsync
492+
# (take care to what you do; this will be silently added to the
493+
# command line.)
494+
export BM_UPLOAD_RSYNC_EXTRA_OPTIONS=""
495+
496+
# Do you want to limit the maximum available bandwidth rsync
497+
# can use ?
498+
# By default, no bandwidth limit is applied.
499+
# Example: 32M, 1024K, ...
500+
export BM_UPLOAD_RSYNC_BANDWIDTH_LIMIT=""
501+
457502
##############################################################
458503
# Section "BURNING"
459504
# - Automatic CDR/CDRW/DVDR burning
@@ -520,9 +565,9 @@ export BM_LOGGER_FACILITY="user"
520565

521566
# Enter here some shell script.
522567
# It will be executed before the first action of backup-manager.
523-
#export BM_PRE_BACKUP_COMMAND="/root/sbin/backups_mount"
568+
export BM_PRE_BACKUP_COMMAND=""
524569

525570
# Enter here some shell script.
526571
# It will be executed after the last action of backup-manager.
527-
#export BM_POST_BACKUP_COMMAND="/root/sbin/backups_umount"
572+
export BM_POST_BACKUP_COMMAND=""
528573

etc/xenbackup.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
######################################
99

1010
# backup target device
11-
BCKDEV="/dev/sdb3"
11+
BCKDEV="/dev/sdc1"
1212
BCKDEV_FS="ext4"
1313

1414
# backup device mount point
@@ -40,7 +40,7 @@ DOMAINN=`/bin/hostname -d`
4040
## LVM PARAMS
4141
######################################
4242
# snapshot size / capacity
43-
SNAPSIZE="10G"
43+
SNAPSIZE="7G"
4444

4545

4646
### EMAIL MESSAGING
@@ -77,3 +77,4 @@ BIN_LVCREATE=$(which lvcreate) || true
7777
BIN_LVREMOVE=$(which lvremove) || true
7878
BIN_MKDIR=$(which mkdir) || true
7979
BIN_CAT=$(which cat) || true
80+
BIN_TAIL=$(which tail) || true

usr/local/sbin/backup_all_guests

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ echo " "
2222
$BIN_MOUNT -t $BCKDEV_FS $BCKDEV $BCKMNTP && echo "done. " || echo "could NOT mount Backup Device (or still mounted) !"
2323
echo " "
2424
echo "space:"
25-
$BIN_DF -h $BCKMNTP
25+
$BIN_DF -hT $BCKMNTP | $BIN_TAIL -n +2
2626

2727
# debug
2828
#exit
@@ -82,8 +82,10 @@ do
8282
echo " "
8383
$BIN_DATE
8484
echo " "
85+
#for debug of
8586
echo "starte BACKUP-MANAGER:"
86-
$BIN_BACKUPMAN -v -c $BM_CONFIGFILE
87+
$BIN_BACKUPMAN -v -c $BM_CONFIGFILE 2>%1
88+
#
8789
echo " "
8890
echo "beende BACKUP-MANAGER:"
8991
echo " "

0 commit comments

Comments
 (0)