mirror of https://github.com/ekimekim/wubloader
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
352 B
Plaintext
14 lines
352 B
Plaintext
5 years ago
|
#! /bin/bash
|
||
|
NAME=${1:-postgres}
|
||
|
CONTAINER=$(docker ps --format "{{.Names}}" | grep "$NAME")
|
||
|
if [ -z "$CONTAINER" ]
|
||
|
then
|
||
|
echo "Container not found"
|
||
|
exit 1
|
||
|
fi
|
||
|
FILE="wubloader-$(date +%Y-%m-%dT%H:%M:%S).sql"
|
||
|
echo "Dumping $CONTAINER to $FILE"
|
||
|
docker exec $CONTAINER pg_dump wubloader -U postgres > $FILE
|
||
|
aws s3 cp $FILE s3://wubloader-test
|
||
|
rm $FILE
|