Call through to cp -p for copying

This commit is contained in:
Frederik Ring
2021-12-10 12:45:34 +01:00
parent 7a5068446a
commit 038116c3a3
3 changed files with 11 additions and 48 deletions

View File

@@ -30,8 +30,8 @@ services:
BACKUP_PRUNING_LEEWAY: 5s
BACKUP_PRUNING_PREFIX: test
GPG_PASSPHRASE: 1234secret
BACKUP_UID: '1000'
BACKUP_GID: '1000'
BACKUP_UID: ${BACKUP_UID:-1000}
BACKUP_GID: ${BACKUP_GID:-1000}
volumes:
- ./local:/archive
- app_data:/backup/app_data:ro

View File

@@ -6,11 +6,11 @@ cd $(dirname $0)
mkdir -p local
docker-compose up -d
BACKUP_UID=$(id -u) BACKUP_GID=$(id -g) docker-compose up -d
sleep 5
docker-compose exec offen ln -s /var/opt/offen/offen.db /var/opt/offen/db.link
docker-compose exec backup backup
BACKUP_UID=$(id -u) BACKUP_GID=$(id -g) docker-compose exec offen ln -s /var/opt/offen/offen.db /var/opt/offen/db.link
BACKUP_UID=$(id -u) BACKUP_GID=$(id -g) docker-compose exec backup backup
docker run --rm -it \
-v compose_backup_data:/data alpine \
@@ -21,8 +21,8 @@ echo "[TEST:PASS] Found relevant files in untared remote backup."
test -L ./local/test.latest.tar.gz.gpg
owner=$(stat -c '%U:%G' ./local/test.tar.gz.gpg)
if [ "$owner" != "1000:1000" ]; then
echo "[TEST:FAIL] Expected backup file to have correct owners, got $owner"
if [ "$owner" != "$(id -un):$(id -gn)" ]; then
echo "[TEST:FAIL] Expected backup file to have correct owners, expected "$(id -un):$(id -gn)", got $owner"
exit 1
fi