yage
fa9bb38462
===================================================================== Finally decided to port personal scripts into a standalone library. --- Release Notes ------------------------ - added support for python, zsh, and zx scripts - added support for "interactive" scripts which drop the user to a REPL - added support for passing arguments to commands - added support for python/node virtualenv management through scwrypts - added contributing and usage docs - updated zsh plugin to write commands to history - licensed under GPLv3 --- New Scripts -------------------------- zsh/scwrypts ) - configure - environment/copy - environment/delete - environment/edit - environment/synchronize - logs/clear - logs/view zsh ) - aws/ecr/login - aws/efs/mount - aws/efs/unmount - aws/route53/backup - aws/s3/media-sync/pull - aws/s3/media-sync/push python ) - redis/interactive =====================================================================
35 lines
860 B
Bash
Executable File
35 lines
860 B
Bash
Executable File
#!/bin/zsh
|
|
source ${0:a:h}/common.zsh
|
|
__CHECK_IMPORTS
|
|
#####################################################################
|
|
|
|
_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
|