mysql_checkpoint.sh 239 Bytes
Newer Older
kaiyou's avatar
kaiyou committed
1 2 3
#!/bin/sh

PROJECTDIR=$1
kaiyou's avatar
kaiyou committed
4
BASEDIR=${2:-.}
kaiyou's avatar
kaiyou committed
5
SERVICE=${3:-db}
kaiyou's avatar
kaiyou committed
6
BACKUP=$(date +%s)
kaiyou's avatar
kaiyou committed
7 8 9 10

cd $PROJECTDIR
docker-compose stop $SERVICE
rm $BASEDIR/wal/*
kaiyou's avatar
kaiyou committed
11
tar -zcf $BASEDIR/wal/$BACKUP.tar.gz $BASEDIR/db
kaiyou's avatar
kaiyou committed
12 13
docker-compose up -d $SERVICE
ls -lah $BASEDIR/wal