Sync repo.
This commit is contained in:
@@ -31,10 +31,10 @@ function backup_disk {
|
||||
vg=$(lvs | grep $snapshot_name | cut -d" " -f4)
|
||||
snap_volume=/dev/$vg/$snapshot_name
|
||||
|
||||
mount -onouuid,ro $snap_volume /data1/snapshot
|
||||
mount -onouuid,ro $snap_volume ${CONFLUENCE_HOME_SNAP}
|
||||
|
||||
# Create new variable to define source of backup as snapshot
|
||||
CONFLUENCE_HOME_SNAP=/data1/snapshot/CONFLUENCE-home/
|
||||
# CONFLUENCE_HOME_SNAP=/data2/snapshot/CONFLUENCE-home/
|
||||
|
||||
# rsync home from snapshot
|
||||
# perform_rsync_home_directory
|
||||
@@ -43,23 +43,16 @@ function backup_disk {
|
||||
perform_rsync_compress_data
|
||||
|
||||
# unmount and remove lvm snapshot
|
||||
umount /data1/snapshot
|
||||
umount ${CONFLUENCE_HOME_SNAP}
|
||||
lvremove -f $snap_volume
|
||||
|
||||
}
|
||||
|
||||
function perform_compress_data {
|
||||
|
||||
# Globals
|
||||
backupDir="/backup/confluence"
|
||||
pgdump="pg_dump"
|
||||
|
||||
# Backup target directories
|
||||
backupDirDaily="$backupDir/$day_new_format"
|
||||
day_new_format=$(date +%Y-%m-%d)
|
||||
tar -czPf $backupDirDaily/$day_new_format.tgz /data1/snapshot
|
||||
tar -czPf $CONFLUENCE_TMP/$day_new_format.tgz $CONFLUENCE_HOME_SNAP
|
||||
}
|
||||
|
||||
function perform_rsync_compress_data {
|
||||
rsync -avh --progress $backupDirDaily/$day_new_format.tgz /backup/confluence
|
||||
}
|
||||
rsync --remove-source-files -h $CONFLUENCE_TMP/$day_new_format.tgz $CONFLUENCE_BACKUP_HOME/
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user