mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-10 00:30:29 +01:00
27 lines
490 B
Bash
27 lines
490 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
set -e
|
||
|
|
||
|
cd $(dirname $0)
|
||
|
|
||
|
mkdir -p local
|
||
|
|
||
|
docker-compose up -d
|
||
|
|
||
|
# sleep until a backup is guaranteed to have happened on the 1 minute schedule
|
||
|
sleep 100
|
||
|
|
||
|
docker-compose down --volumes
|
||
|
|
||
|
if [ ! -f ./local/conf.tar.gz ]; then
|
||
|
echo "[TEST:FAIL] Config from file was not used."
|
||
|
exit 1
|
||
|
fi
|
||
|
echo "[TEST:PASS] Config from file was used."
|
||
|
|
||
|
if [ -f ./local/never.tar.gz ]; then
|
||
|
echo "[TEST:FAIL] Unexpected file was found."
|
||
|
exit 1
|
||
|
fi
|
||
|
echo "[TEST:PASS] Unexpected cron did not run."
|