Add support for remote backup server.
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
|
||||
filesystem=`df`
|
||||
|
||||
label=`tune2fs -l $backup_partition | grep -e "Filesystem volume name:" | awk '{print$4}'`
|
||||
#label=`tune2fs -l $backup_partition | grep -e "Filesystem volume name:" | awk '{print$4}'`
|
||||
#label="Root filesystem - /backup"
|
||||
|
||||
content_type='Content-Type: text/plain;\n charset="utf-8"'
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
datum=`date +"%d.%m.%Y"`
|
||||
|
||||
echo -e "To:${admin_email}\n${content_type}\nSubject:Backup $company -- $datum\n$filesystem\n\ndisk label: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $admin_email
|
||||
echo -e "To:${admin_email}\n${content_type}\nSubject:Backup $company -- $datum\n$filesystem\n\nBackup resource / Label: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $admin_email
|
||||
if [[ -n "$extra_admin_email" ]]; then
|
||||
echo -e "To:${extra_admin_email}\n${content_type}\nSubject:Backup $company -- $datum\n$filesystem\n\ndisk label: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $extra_admin_email
|
||||
fi
|
||||
@ -47,7 +47,7 @@
|
||||
err_msg="`grep -A 2 -B 1 -e\"\[ERROR\" $logFile`\n"
|
||||
warn_msg="`grep -A 2 -B 2 -e\"\[WARN\" $logFile`\n"
|
||||
|
||||
msg_top="Backup $company vom $datum.\nBackupprozess (disk label: $label) beendet mit:"
|
||||
msg_top="Backup $company vom $datum.\nBackup resource / Label: $label\nBackupprozess beendet mit:"
|
||||
msg_body_01="\t$error Error(s)\n\t$warning Warning(s)\n"
|
||||
msg_body_02="\n\n--- ERROR(S) ---\n${err_msg}\n\n--- WARNING(S) ...\n${warn_msg}"
|
||||
|
||||
|
@ -47,6 +47,12 @@ hosts_base_dir=$crontab_base_dir/hosts
|
||||
extern_usb_disk=false
|
||||
extern_sata_disk=false
|
||||
intern_disk=false
|
||||
# - remote_disk
|
||||
# -
|
||||
# - - You need a fstab-entry in order to mount the backup partition
|
||||
# - - Configure 'backup_mountpoint'
|
||||
# -
|
||||
remote_disk=true
|
||||
|
||||
## - if backup partion cannot be determined, try this one..
|
||||
## -
|
||||
@ -108,6 +114,8 @@ if $extern_usb_disk || $extern_sata_disk ; then
|
||||
fi
|
||||
|
||||
fi
|
||||
elif $remote_disk ; then
|
||||
backup_resource="$(grep "$backup_mountpoint" /etc/fstab | grep -v -E "\s*#" | awk '{print$1}' | head -1)"
|
||||
elif $intern_disk ; then
|
||||
if $crypto_backup_device ; then
|
||||
backup_raw_partition=$_backup_partition
|
||||
@ -182,7 +190,7 @@ _DEBUG=0
|
||||
#
|
||||
_TEST=0
|
||||
|
||||
export LOCK_DIR admin_email from_address content_type company hosts_base_dir intern_disk extern_usb_disk extern_sata_disk crypto_backup_device backup_base_dir backup_partition check_mountpoint info_file logFile logDuration right_tabstop disk_label_log_file force_level_1 MIRROR ARCHIVE days _DEBUG _TEST
|
||||
export LOCK_DIR admin_email from_address content_type company hosts_base_dir intern_disk extern_usb_disk extern_sata_disk crypto_backup_device backup_base_dir backup_partition backup_resource check_mountpoint info_file logFile logDuration right_tabstop disk_label_log_file force_level_1 MIRROR ARCHIVE days _DEBUG _TEST
|
||||
|
||||
#
|
||||
# ------------------ Ende Variable ------------------ #
|
||||
|
Reference in New Issue
Block a user