Skip to content

Commit

Permalink
Update mysqldump command
Browse files Browse the repository at this point in the history
  • Loading branch information
taurthil committed May 16, 2022
1 parent d5616d4 commit a0b2dd8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,48 @@ Plugin for Oh-My-Zsh bash that makes it easy to work with Docker and Magento 2.

- Docker
- Oh-My-Zsh [www](https://github.com/robbyrussell/oh-my-zsh)
- Tups (packages)

## Instalation

- Clone a repository to **~/.oh-my-zsh/custom/plugins**
- In the file **~/.zshrc**, add an entry **plugins=(mage2docker)**


## Help

"ash"

"ash-user"

"bash-www"

"bash"

"logs"
"magento"
"mage"
"mage-cache"
"mage-reindex"
"mage-di"
"mage-upgrade"
"mage-report"
"mage-log"
"grunt"
"watch"
"rename"
"rm"
"restart"
"stop"
"inspect"
"top"
"mysqldump"
"mysql"
"ip"
"vst"
"varnish-purge"
"redis-flushall"

## License
```
/*
Expand Down
6 changes: 4 additions & 2 deletions mage2docker.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ _mage2docker_log() {
_mage2docker_mysql_data() {
printf '%s ' 'User name:'
read user
printf '%s ' 'User password:'
read password
printf '%s ' 'Database name:'
read database
printf '%s ' 'file name:'
Expand Down Expand Up @@ -178,12 +180,12 @@ mage2docker() {
;;
mysqldump)
_mage2docker_mysql_data
mysqldump -h$(_mage2docker_container_ip $1) -u$user -p $database >$file
docker exec $1 /usr/bin/mysqldump -u $user --password=$password $database > $file.sql
echo "Success database backup was created"
;;
mysql)
_mage2docker_mysql_data
mysql -h$(_mage2docker_container_ip $1) -u$user -p $database <$file
docker exec $1 /usr/bin/mysql -u $user --password=$password $database < $file.sql
echo "Success database restore"
;;
help)
Expand Down

0 comments on commit a0b2dd8

Please sign in to comment.