|
|
@ -235,6 +235,11 @@ vps_check() { |
|
|
|
|
|
|
|
|
|
|
|
vps:rsync() { |
|
|
|
rsync_options=() |
|
|
|
while [[ "$1" == "-"* ]]; do |
|
|
|
rsync_options+=("$1") |
|
|
|
shift |
|
|
|
done |
|
|
|
local vps="$1" id="$2" src="$3" dst="$4" |
|
|
|
if [[ "$src" != *":"* ]]; then |
|
|
|
err "Third argument '$src' should be a remote (include the server name as prefix)." |
|
|
@ -246,7 +251,7 @@ vps:rsync() { |
|
|
|
rsync -e "ssh ${ssh_options[*]}" \ |
|
|
|
-azvArH --delete --delete-excluded \ |
|
|
|
--partial --partial-dir .rsync-partial \ |
|
|
|
--numeric-ids \ |
|
|
|
--numeric-ids ${rsync_options[*]} \ |
|
|
|
"$server":/var/mirror/"${id}${src}" "${dst}" |
|
|
|
EOF |
|
|
|
|
|
|
@ -322,7 +327,8 @@ EOF |
|
|
|
for vol in postfix rspamd redis crypt vmail{,-attachments}; do |
|
|
|
volume_name="mailcowdockerized_${vol}-vol-1" |
|
|
|
volume_dir="/var/lib/docker/volumes/${volume_name}/_data" |
|
|
|
if ! ssh:run "root@$server" -- "[ -d '$BACKUP_PATH/${id}${volume_dir}' ]"; then |
|
|
|
if ! vps:rsync -nd --no-r "$vps" "$id" "$server":"${volume_dir}/" "/tmp/dummy" >/dev/null 2>&1; then |
|
|
|
warn "No '$volume_name' in backup. This might be expected." |
|
|
|
continue |
|
|
|
fi |
|
|
|
|
|
|
|