Skip to content

Instantly share code, notes, and snippets.

@dannygsmith dannygsmith/wp-db-backup
Last active Oct 3, 2017

What would you like to do?
backup all valet-plus databases
#!/usr/bin/env bash
export PATH="/usr/local/bin:$PATH";
SUFFIX=`date "+%w"`
readarray arr < /Users/riskiii/bin/hosts.txt
## now loop through the above array
for k in "${arr[@]}"
printf -v x "%s%s-%s.sql" "/Users/riskiii/Dropbox/backups/" $k $SUFFIX
/usr/local/bin/mysqldump --defaults-file="/Users/riskiii/bin/my.txt" \
--add-drop-table $k \
> $x 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.