Last active
October 3, 2017 18:54
-
-
Save dannygsmith/38c2c7b5d36f4247bf7eb7bff3c0f1c1 to your computer and use it in GitHub Desktop.
backup all valet-plus databases
This file contains 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
#!/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[@]}" | |
do | |
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 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment