fix: file changed as tar read it
This commit is contained in:
parent
8b15f665ef
commit
caaa607e94
3 changed files with 19 additions and 13 deletions
|
|
@ -97,13 +97,15 @@ for file in 'attachments' 'sends' 'rsa_key.pem' 'rsa_key.pub.pem'; do # 'config
|
|||
done
|
||||
|
||||
# Copy everything over to local machine.
|
||||
echo 'Info: Creating archive'
|
||||
remote_archive="$( ssh "${remote}" 'mktemp' )"
|
||||
ssh "${remote}" "tar -czf '${remote_archive}' ${remote_destination}"
|
||||
echo 'Info: Copying to local machine.'
|
||||
ssh "${remote}" "tar -czf '${remote_destination}/${backupfile}' --exclude=${backupfile} ${remote_destination}"
|
||||
scp "${remote}:${remote_destination}/${backupfile}" "${local_destination}"
|
||||
scp "${remote}:${remote_archive}" "${local_destination}/${backupfile}"
|
||||
|
||||
# Remove temporary destination on remote host.
|
||||
printf "Debug: Cleaning up '%s' on %s.\n" "${remote_destination}" "${remote}"
|
||||
ssh "${remote}" "rm -rf ${remote_destination}"
|
||||
printf "Debug: Cleaning up '%s' on %s.\n" "${remote_destination},${remote_archive}" "${remote}"
|
||||
ssh "${remote}" "rm -rf ${remote_destination} ${remote_archive}"
|
||||
|
||||
# Backup cleanup
|
||||
# Only keep 30 days of backups, seems about right.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue