0

I have a script to perform a synchronisation between the local and production databases. In this script, there is a command to import the production.sql to my development database. It's a bit long, so I would like to add a progress bar.

The command works when I type it directly in my terminal, but when it's executed by the script, I can see the progress bar, but it's doesn't progress. It remains at 0% until the end of the progression.

no progress This the part of my script:

log "Restore DB..."
if brew ls pv > /dev/null; then
    pv tmp/$dump | mysql -u rails_bots -h 127.0.0.1 -prails_bots $database < tmp/$dump
else
    mysql -u rails_bots -h 127.0.0.1 -prails_bots $database < tmp/$dump
fi

Do you know why it doesn't work in my script?

4

0 回答 0