yage
6333a2f6b8
===================================================================== --- New Scripts -------------------------- zsh ) vundle-vim helpers - vim/vundle/edit-build-actions - vim/vundle/install - vim/vundle/rebuild quick install-from-source scripts - git/package/install - git/package/build (install --only-build) - git/package/download (install --only-pull) - git/package/update (install --update) config sym-linker (for source-controlled .configs) - config/update (symlinks + terminfo) - config/symlinks (set all symlinks from settings) - config/settings (edit settings which aren't scwrypts env variables) - config/terminfo (load all terminfo from settings) --- Changes ------------------------------ - helper comments are now inserted in all env files - removed underscore prefix for standard AWS environment variables - added "opening" and "finished editing" comments to __EDIT util - added __USAGE to format $USAGE variable to std:err - added __ERROR_CHECK to exit if any __ERROR(s) were called
36 lines
878 B
Bash
Executable File
36 lines
878 B
Bash
Executable File
#!/bin/zsh
|
|
_DEPENDENCIES+=()
|
|
_REQUIRED_ENV+=()
|
|
source ${0:a:h}/common.zsh
|
|
#####################################################################
|
|
|
|
_ROUTE53_BACKUP() {
|
|
local BACKUP_PATH="$SCWRYPTS_OUTPUT_PATH/$ENV_NAME/aws-dns-backup/$(date '+%Y-%m-%d')"
|
|
mkdir -p $BACKUP_PATH >/dev/null 2>&1
|
|
|
|
local DOMAIN
|
|
local JOBS=()
|
|
for DOMAIN in $(_ROUTE53_GET_DOMAINS)
|
|
do
|
|
( __STATUS "creating '$BACKUP_PATH/$DOMAIN.txt'" \
|
|
&& cli53 export --profile $AWS_PROFILE $DOMAIN > "$BACKUP_PATH/$DOMAIN.txt" \
|
|
&& __SUCCESS "backed up '$DOMAIN'" \
|
|
|| __ERROR "failed to back up '$DOMAIN'" \
|
|
) &
|
|
JOBS+=$!
|
|
done
|
|
|
|
local P
|
|
for P in ${JOBS[@]}; do wait $P >/dev/null 2>&1; done
|
|
}
|
|
|
|
_ROUTE53_GET_DOMAINS() {
|
|
cli53 list --profile $AWS_PROFILE \
|
|
| awk '{print $2;}' \
|
|
| sed '1d; s/\.$//'\
|
|
;
|
|
}
|
|
|
|
#####################################################################
|
|
_ROUTE53_BACKUP
|