fix remove source file flag

This commit is contained in:
simon 2023-03-06 16:06:53 +07:00
parent 6f25ae8460
commit 4591a0e032
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -12,11 +12,11 @@ echo "------------------------------------------------------------"
printf "\n -> backup\n" printf "\n -> backup\n"
ssh $remote_host 'docker exec postgres pg_dump -U archivist | gzip > backup.gz' ssh $remote_host 'docker exec postgres pg_dump -U archivist | gzip > backup.gz'
printf "\n -> download\n" printf "\n -> download\n"
rsync --progress -r --delete-after -e ssh $remote_host:backup.gz /tmp/backup.gz rsync --progress -r --remove-source-files -e ssh $remote_host:backup.gz /tmp/backup.gz
# sync # sync
printf "\n -> sync\n" printf "\n -> sync\n"
rsync --progress -r --delete-after /tmp/backup.gz -e ssh $local_host:backup rsync --progress -r --remove-source-files /tmp/backup.gz -e ssh $local_host:backup
ssh $local_host 'gzip -df backup/backup.gz' ssh $local_host 'gzip -df backup/backup.gz'
# replace # replace