File: simplesession

package info (click to toggle)
borgbackup2 2.0.0b5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,716 kB
  • sloc: python: 28,121; pascal: 3,061; ansic: 1,889; sh: 172; makefile: 156; tcl: 94
file content (69 lines) | stat: -rwxr-xr-x 1,289 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash

#Fail on error
set -e

export HOME=$AUTOPKGTEST_TMP/home
mkdir "$HOME"
DATA=$AUTOPKGTEST_TMP/data
export BORG_REPO=$AUTOPKGTEST_TMP/borgrepo
MOUNT=$AUTOPKGTEST_TMP/mnt

cd $AUTOPKGTEST_TMP

borg() {
	borg2 "$@"
}

echo "Checking borg is callable"
borg --version

echo "Creating source data dir and mountpoint"
mkdir $DATA
mkdir $MOUNT

echo "Calling borg rcreate"
borg rcreate --encryption none

# create source data

echo "Creating runone"
echo Hello, world > $DATA/file1
borg create runone data/

echo "Creating runtwo"
echo Hello again > $DATA/file2
borg create runtwo data/

echo "Listing archives"
borg rlist

echo "Listing runone and runtwo contents"
borg list runone
borg list runtwo

echo "Testing borg extract --stdout"
borg extract --stdout runtwo data/file1 | grep -q "world"
borg extract --stdout runtwo data/file2 | grep -q "again"

echo "Mounting runtwo via fuse"
borg mount runtwo $MOUNT

echo "Checking file contents in the fuse mount"
cmp $DATA/file1 $MOUNT/data/file1
cmp $DATA/file2 $MOUNT/data/file2

echo "Unmounting runtwo"
fusermount -u $MOUNT

echo "Mounting runone via fuse"
borg mount runone $MOUNT

echo "Checking file contents"
cmp $DATA/file1 $MOUNT/data/file1
test ! -e $MOUNT/data/file2

echo "Unmounting"
fusermount -u $MOUNT

echo "All good!"