Compare commits
No commits in common. "d30dabc5342a878d7808a91b3c2a7773c55fce6e" and "d696c19242a552237ea7e08e1c4ace97cae4b4cf" have entirely different histories.
d30dabc534
...
d696c19242
|
@ -6,9 +6,7 @@ sleep $((16#$(ip a | grep "link/ether" | head -1 | awk -F ':' '{print $6}' | awk
|
||||||
number_of_full_to_keep='<%= @full_backup_retention %>'
|
number_of_full_to_keep='<%= @full_backup_retention %>'
|
||||||
fork_limit=30 #in GB, if bigger than this number, we fork the backup to it's own process
|
fork_limit=30 #in GB, if bigger than this number, we fork the backup to it's own process
|
||||||
customer="<%= @customer %>"
|
customer="<%= @customer %>"
|
||||||
environment="<%= @environment %>"
|
|
||||||
declare -A extra_backup_jobs
|
declare -A extra_backup_jobs
|
||||||
|
|
||||||
#<% if @extra_backup_jobs.any? %>
|
#<% if @extra_backup_jobs.any? %>
|
||||||
#<% @extra_backup_jobs.each do |client, job| %>
|
#<% @extra_backup_jobs.each do |client, job| %>
|
||||||
extra_backup_jobs["<%= client %>"]="<%= job %>"
|
extra_backup_jobs["<%= client %>"]="<%= job %>"
|
||||||
|
@ -53,7 +51,7 @@ function do_backup {
|
||||||
rclone mkdir ${mirror}:${mirrorbucket}
|
rclone mkdir ${mirror}:${mirrorbucket}
|
||||||
duplicity --full-if-older-than 1M --asynchronous-upload --tempdir /mnt --archive-dir /mnt --no-encryption ${mountpoint} rclone://${mirror}:/${mirrorbucket}
|
duplicity --full-if-older-than 1M --asynchronous-upload --tempdir /mnt --archive-dir /mnt --no-encryption ${mountpoint} rclone://${mirror}:/${mirrorbucket}
|
||||||
if [[ "${extra_backup_jobs[${customer}]:+found}" == "found" ]] && [[ -f "${extra_backup_jobs[${customer}]}" ]]; then
|
if [[ "${extra_backup_jobs[${customer}]:+found}" == "found" ]] && [[ -f "${extra_backup_jobs[${customer}]}" ]]; then
|
||||||
${extra_backup_jobs[${customer}]} ${project} ${mirror} ${bucket} ${customer} ${environment}
|
${extra_backup_jobs[${customer}]}
|
||||||
fi
|
fi
|
||||||
umount ${mountpoint}
|
umount ${mountpoint}
|
||||||
rmdir ${mountpoint}
|
rmdir ${mountpoint}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
project="${1}"
|
environ="prod"
|
||||||
mirror="${2}"
|
if [[ $(hostname -d) == "drive.test.sunet.se" ]]; then
|
||||||
bucket="${3}"
|
environ="test"
|
||||||
customer="${4}"
|
fi
|
||||||
environment="${5}"
|
rsync -e "ssh -i ${HOME}/.ssh/id_script" -avz /opt/backupmounts/ "sd-${environ}@sd-${environ}-backup.hb.se:~/sd-${environ}"
|
||||||
|
|
||||||
rsync -e "ssh -i ${HOME}/.ssh/id_script" -avz "/opt/backupmounts/${bucket}" "sd-${environment}@sd-${environment}-backup.hb.se:~/sd-${environment}/${bucket}"
|
|
||||||
|
|
Loading…
Reference in a new issue