File: simplesession

package info (click to toggle)
borgbackup 1.4.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,732 kB
  • sloc: python: 26,637; pascal: 3,245; ansic: 2,597; sh: 151; makefile: 137; tcl: 94
file content (63 lines) | stat: -rwxr-xr-x 1,301 bytes parent folder | download | duplicates (6)
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
#!/bin/bash

#Fail on error
set -e

DATA=$AUTOPKGTEST_TMP/data
REPO=$AUTOPKGTEST_TMP/borgrepo
MOUNT=$AUTOPKGTEST_TMP/mnt

cd $AUTOPKGTEST_TMP

echo "Checking borg is callable"
borg --version

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

echo "Calling borg init"
borg init --encryption none $REPO

# create source data

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

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

echo "Listing archives"
borg list $REPO

echo "Listing runone and runtwo contents"
borg list $REPO::runone
borg list $REPO::runtwo

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

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

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

echo "Unmounting $REPO::runtwo"
fusermount -u $MOUNT

echo "Mounting $REPO::runone via fuse"
borg mount $REPO::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!"