This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Dumps every swarm secret into a tar by mounting them all into a throwaway service. | |
| # The tar holds plaintext secrets: encrypt it before moving it off this host. | |
| set -euo pipefail | |
| umask 077 | |
| service_name="backup-all-secrets" | |
| out_dir="${1:-.}" | |
| tar_file="backup_$(date +"%Y%m%d-%H%M%S").tar" |