I have a PrestaShop database running in a docker container that I intend to back up. The thing is, I need to put the e-commerce store into maintenance mode before I run it. Ideally, I intended to run the script on a remote machine - getting it to login via ssh and then interact with the container (via the script) but it seems I may (first) need to log in via ssh then run the script on the server? (as it starts a new shell etc).
These are the parts of the script that I have so far, but I'm just not sure how to put them together to string commands once inside mysql:
#!/bin/bash
# Log in to docker@debVM server via SSH
ssh docker@debVM
# Run the following Docker Container
docker exec -it ps1-7-mariadb-1 /bin/bash
# Login to the database bitnami_prestashop
mysql -u bn_prestashop -pbitnamiUSER bitnami_prestashop
# Run update - store into maintenance mode
UPDATE ps_configuration SET value='0' WHERE name='PS_SHOP_ENABLE';
#Exit the mysql and docker exec
Exit
#run the backup-volumes-container.sh script
echo running the backup-volumes-container.sh script
cd
cd scripts/
./backup-volumes-container.sh ps1-7-mariadb-1
./backup-volumes-container.sh ps1-7-prestashop-1
echo Backup-volumes complete
Hope someone can help - thanks!