diff --git a/src/fuse/srcs/RepoFS.cpp b/src/fuse/srcs/RepoFS.cpp index 295e6ba..2109c9b 100644 --- a/src/fuse/srcs/RepoFS.cpp +++ b/src/fuse/srcs/RepoFS.cpp @@ -43,6 +43,10 @@ static int rfsGetattr(const char *path, struct stat *stbuf) { stbuf->st_mode = S_IFREG | 0444; stbuf->st_nlink = 1; stbuf->st_size = e->file->bytes; + } else if (e->file->fileType == File::Type::Symlink) { + stbuf->st_mode = S_IFLNK | 0777; + stbuf->st_nlink = 1; + stbuf->st_size = e->file->bytes; } } catch (...) { return -ENOENT; } @@ -122,8 +126,21 @@ static int rfsRead(const char *path, char *buf, size_t size, off_t offset, return size; } +static int rfsReadlink(const char *path, char *buf, size_t size) { + DirEntry *entry = &RepoFS::root; + if (std::string(path) != "/") + try { + entry = getf(path); + } catch (...) { return -ENOENT; } + + if (entry->file->fileType != File::Type::Symlink) return -ENOENT; + auto dst = Serialize::deserialize(RepoFS::repo->getObject(entry->file->chunks.at(0))); + strncpy(buf, dst.data.data(), std::min(dst.data.size(), size)); +} + static struct fuse_operations rfsOps = { .getattr = rfsGetattr, + .readlink = rfsReadlink, .open = rfsOpen, .read = rfsRead, .readdir = rfsReaddir, @@ -136,11 +153,6 @@ void RepoFS::start(Repository *repo, std::string path) { auto a = Serialize::deserialize(repo->getObject(r.second)); for (auto const &f: a.files) { auto file = Serialize::deserialize(repo->getObject(f)); - // TODO: symlinks - if (file.fileType == File::Type::Symlink) { - std::cerr << "Symlinks not supported yet!" << std::endl; - continue; - } auto path = std::filesystem::u8path(file.name); DirEntry *entry = &(root.children[std::to_string(a.id)]); entry->isFakeDir = true; diff --git a/tests/clitests/scripts/backup.sh b/tests/clitests/scripts/backup.sh index ee764a4..2ffee4a 100755 --- a/tests/clitests/scripts/backup.sh +++ b/tests/clitests/scripts/backup.sh @@ -18,9 +18,9 @@ echo "testtestasdf" > testdata/1/notempty/testfile dd if=/dev/urandom of=testdata/1/a bs=1M count=$TESTSIZE dd if=/dev/urandom of=testdata/1/b bs=1M count=$TESTSIZE dd if=/dev/urandom of=testdata/1/c bs=1M count=$TESTSIZE -# TODO: Symlink support for mount -#ln -s a testdata/1/l -#ln -s aa testdata/1/aa + +ln -s a testdata/1/l +ln -s aa testdata/1/aa cp -a -p testdata/1 testdata/2 echo "asdf1" > testdata/2/c @@ -31,8 +31,8 @@ sleep 1 cp -a -p testdata/2 testdata/3 echo "asdf2" > testdata/3/a cat testdata/2/a >> testdata/3/a -#rm testdata/3/l -#ln -s b testdata/3/l +rm testdata/3/l +ln -s b testdata/3/l cp -a -p testdata/3 testdata/4 echo "asdf3" > testdata/4/b @@ -57,18 +57,15 @@ echo "Repo created" OUT=$($CMD run --from testdata/1 --repo testdir/to1 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then -if ! ( ( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then +if ! ( ( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then echo "Error backing up 1 dir!" exit 1 fi echo "Backup 1 ok" OUT=$($CMD run --from testdata/2 --repo testdir/to1 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) &&\ -#( echo "$OUT" | grep -q 'Skipped: empty' ) && ( echo "$OUT" | grep -q 'Skipped: l' ) && ( echo "$OUT" | grep -q 'Skipped: notempty' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then -if ! ( ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) &&\ -( echo "$OUT" | grep -q 'Skipped: empty' ) && ( echo "$OUT" | grep -q 'Skipped: notempty' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then +if ! ( ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) &&\ +( echo "$OUT" | grep -q 'Skipped: empty' ) && ( echo "$OUT" | grep -q 'Skipped: l' ) && ( echo "$OUT" | grep -q 'Skipped: notempty' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then echo "Error backing up 2 dir!" exit 1 fi @@ -76,9 +73,7 @@ echo "Backup 2 ok" OUT=$($CMD run --from testdata/3 --repo testdir/to1 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: l' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) &&\ -# ( echo "$OUT" | grep -q 'Skipped: empty' ) && ( echo "$OUT" | grep -q 'Skipped: notempty' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then -if ! ( ( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) &&\ +if ! ( ( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: l' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) &&\ ( echo "$OUT" | grep -q 'Skipped: empty' ) && ( echo "$OUT" | grep -q 'Skipped: notempty' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then echo "$OUT" echo "Error backing up 3 dir!" @@ -88,7 +83,7 @@ echo "Backup 3 ok" OUT=$($CMD run --from testdata/4 --repo testdir/to1 --password asdff --progress simple --verbose 1) echo "$OUT" -if ! ( ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then +if ! ( ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then echo "Error backing up 4 dir!" exit 1 fi @@ -104,7 +99,7 @@ echo "Backup 5 ok" OUT=$($CMD run --from testdata/6 --repo testdir/to1 --password asdff --progress simple --verbose 1) echo "$OUT" -if ! ( ! ( echo "$OUT" | grep -q 'Copied: a' ) && ! ( echo "$OUT" | grep -q 'Skipped: a ' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then +if ! ( ! ( echo "$OUT" | grep -q 'Copied: a' ) && ! ( echo "$OUT" | grep -q 'Skipped: a ' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then echo "Error backing up 6 dir!" exit 1 fi @@ -112,7 +107,7 @@ echo "Backup 6 ok" OUT=$($CMD run --from testdata/7 --repo testdir/to1 --password asdff --progress simple --verbose 1) echo "$OUT" -if ! ( ( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then +if ! ( ( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then echo "Error backing up 7 dir!" exit 1 fi @@ -149,10 +144,8 @@ umount testmount OUT=$($CMD diff --from testdata/4 --repo testdir/to1 --password asdff --progress none --verbose 1 --aid ${AIDS[0]} --aid2 ${AIDS[1]}) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'c is different' ) && ! ( echo "$OUT" | grep -q 'a is different' ) && ! ( echo "$OUT" | grep -q 'l is different' )\ -# && ! ( echo "$OUT" | grep -q 'aa is different' ) && ! ( echo "$OUT" | grep -q 'b is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then -if ! ( ( echo "$OUT" | grep -q 'c is different' ) && ! ( echo "$OUT" | grep -q 'a is different' )\ - && ! ( echo "$OUT" | grep -q 'b is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then +if ! ( ( echo "$OUT" | grep -q 'c is different' ) && ! ( echo "$OUT" | grep -q 'a is different' ) && ! ( echo "$OUT" | grep -q 'l is different' )\ + && ! ( echo "$OUT" | grep -q 'aa is different' ) && ! ( echo "$OUT" | grep -q 'b is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then echo "Error comparing archive 1 and 2!" exit 1 fi @@ -161,10 +154,7 @@ echo "OK comparing archive 1 and 2" OUT=$($CMD diff --from testdata/4 --repo testdir/to1 --password asdff --progress none --verbose 1 --aid ${AIDS[1]} --aid2 ${AIDS[2]}) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'a is different' ) && ( echo "$OUT" | grep -q 'l is different' ) && ! ( echo "$OUT" | grep -q 'c is different' ) \ -#&& ! ( echo "$OUT" | grep -q 'b is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then - -if ! ( ( echo "$OUT" | grep -q 'a is different' ) && ! ( echo "$OUT" | grep -q 'c is different' ) \ +if ! ( ( echo "$OUT" | grep -q 'a is different' ) && ( echo "$OUT" | grep -q 'l is different' ) && ! ( echo "$OUT" | grep -q 'c is different' ) \ && ! ( echo "$OUT" | grep -q 'b is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then echo "Error comparing archive 2 and 3!" exit 1 @@ -173,8 +163,7 @@ echo "OK comparing archive 2 and 3" OUT=$($CMD diff --diff-mode file --from testdata/4 --prefix a --repo testdir/to1 --password asdff --progress none --verbose 1 --aid ${AIDS[1]} --aid2 ${AIDS[2]}) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'a is different' ) && ! ( echo "$OUT" | grep -q 'l is different' ) ); then -if ! ( ( echo "$OUT" | grep -q 'a is different' ) ); then +if ! ( ( echo "$OUT" | grep -q 'a is different' ) && ! ( echo "$OUT" | grep -q 'l is different' ) ); then echo "Error comparing archive 2 and 3! (file 1)" exit 1 fi @@ -182,8 +171,7 @@ echo "OK comparing archive 2 and 3 (file 1)" OUT=$($CMD diff --diff-mode file --from testdata/4 --prefix l --repo testdir/to1 --password asdff --progress none --verbose 1 --aid ${AIDS[1]} --aid2 ${AIDS[2]}) echo "$OUT" -#if ! ( ! ( echo "$OUT" | grep -q 'a is different' ) && ( echo "$OUT" | grep -q 'l is different' ) ); then -if ! ( ! ( echo "$OUT" | grep -q 'a is different' ) ); then +if ! ( ! ( echo "$OUT" | grep -q 'a is different' ) && ( echo "$OUT" | grep -q 'l is different' ) ); then echo "Error comparing archive 2 and 3! (file 2)" exit 1 fi @@ -191,8 +179,7 @@ echo "OK comparing archive 2 and 3 (file 2)" OUT=$($CMD diff --diff-mode file --from testdata/4 --prefix b --repo testdir/to1 --password asdff --progress none --verbose 1 --aid ${AIDS[1]} --aid2 ${AIDS[2]}) echo "$OUT" -#if ! ( ! ( echo "$OUT" | grep -q 'a is different' ) && ! ( echo "$OUT" | grep -q 'l is different' ) && ( echo "$OUT" | grep -q 'b are same' ) ); then -if ! ( ! ( echo "$OUT" | grep -q 'a is different' ) && ( echo "$OUT" | grep -q 'b are same' ) ); then +if ! ( ! ( echo "$OUT" | grep -q 'a is different' ) && ! ( echo "$OUT" | grep -q 'l is different' ) && ( echo "$OUT" | grep -q 'b are same' ) ); then echo "Error comparing archive 2 and 3! (file 3)" exit 1 fi @@ -200,10 +187,8 @@ echo "OK comparing archive 2 and 3 (file 3)" OUT=$($CMD diff --from testdata/4 --repo testdir/to1 --password asdff --progress none --verbose 1 --aid ${AIDS[2]}) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'b is different' ) && ! ( echo "$OUT" | grep -q 'a is different' ) && ! ( echo "$OUT" | grep -q 'l is different' ) \ -#&& ! ( echo "$OUT" | grep -q 'aa is different' ) && ! ( echo "$OUT" | grep -q 'c is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then -if ! ( ( echo "$OUT" | grep -q 'b is different' ) && ! ( echo "$OUT" | grep -q 'a is different' ) \ - && ! ( echo "$OUT" | grep -q 'c is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then +if ! ( ( echo "$OUT" | grep -q 'b is different' ) && ! ( echo "$OUT" | grep -q 'a is different' ) && ! ( echo "$OUT" | grep -q 'l is different' ) \ +&& ! ( echo "$OUT" | grep -q 'aa is different' ) && ! ( echo "$OUT" | grep -q 'c is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then echo "Error comparing archive 3 and current!" exit 1 fi @@ -211,10 +196,8 @@ echo "OK comparing archive 3 and current" OUT=$($CMD diff --from testdata/3 --repo testdir/to1 --password asdff --progress none --verbose 1 ) echo "$OUT" -#if ! ( ! ( echo "$OUT" | grep -q 'b is different' ) && ( echo "$OUT" | grep -q 'a is different' ) && ( echo "$OUT" | grep -q 'l is different' )\ -# && ! ( echo "$OUT" | grep -q 'aa is different' ) && ( echo "$OUT" | grep -q 'c is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then -if ! ( ! ( echo "$OUT" | grep -q 'b is different' ) && ( echo "$OUT" | grep -q 'a is different' )\ - && ( echo "$OUT" | grep -q 'c is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then +if ! ( ! ( echo "$OUT" | grep -q 'b is different' ) && ( echo "$OUT" | grep -q 'a is different' ) && ( echo "$OUT" | grep -q 'l is different' )\ + && ! ( echo "$OUT" | grep -q 'aa is different' ) && ( echo "$OUT" | grep -q 'c is different' ) && ! ( echo "$OUT" | grep -q 'empty is different' ) && ! ( echo "$OUT" | grep -q 'notempty is different' ) ); then echo "Error comparing archive last and current!" exit 1 fi @@ -229,8 +212,7 @@ echo "Repo created" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( (echo "$OUT" | grep -q 'Backup is full because there are no backups')&&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then -if ! ( (echo "$OUT" | grep -q 'Backup is full because there are no backups')&&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then +if ! ( (echo "$OUT" | grep -q 'Backup is full because there are no backups')&&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then echo "Error backing up 1 dir!" exit 1 fi @@ -238,8 +220,7 @@ echo "Backup 1 ok" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' )); then -if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' )); then +if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' )); then echo "Error backing up 2 dir!" exit 1 fi @@ -247,8 +228,7 @@ echo "Backup 2 ok" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' )&& ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then -if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' )&& ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then +if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' )&& ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then echo "Error backing up 3 dir!" exit 1 fi @@ -256,8 +236,7 @@ echo "Backup 3 ok" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the interval') &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' )); then -if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the interval') &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' )); then +if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the interval') &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' )); then echo "Error backing up 4 dir!" exit 1 fi @@ -265,8 +244,7 @@ echo "Backup 4 ok" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then -if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then +if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then echo "Error backing up 5 dir!" exit 1 fi @@ -274,8 +252,7 @@ echo "Backup 5 ok" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then -if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then +if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then echo "Error backing up 6 dir!" exit 1 fi @@ -283,8 +260,7 @@ echo "Backup 6 ok" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the interval' ) &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then -if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the interval' ) &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then +if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the interval' ) &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then echo "Error backing up 7 dir!" exit 1 fi @@ -292,8 +268,7 @@ echo "Backup 7 ok" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1 --type full) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the config') &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' )); then -if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the config') &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' )); then +if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the config') &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' )); then echo "Error backing up 8 dir!" exit 1 fi @@ -301,8 +276,7 @@ echo "Backup 8 ok" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then -if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then +if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then echo "Error backing up 9 dir!" exit 1 fi @@ -310,8 +284,7 @@ echo "Backup 9 ok" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then -if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then +if ! ( ! ( echo "$OUT" | grep -q 'Backup is full' ) && ( echo "$OUT" | grep -q 'Skipped: a' ) && ( echo "$OUT" | grep -q 'Skipped: aa' ) && ( echo "$OUT" | grep -q 'Skipped: b' ) && ( echo "$OUT" | grep -q 'Skipped: c' ) ); then echo "Error backing up 10 dir!" exit 1 fi @@ -319,8 +292,7 @@ echo "Backup 10 ok" OUT=$($CMD run --from testdata/1 --repo testdir/to2 --password asdff --progress simple --verbose 1) echo "$OUT" -#if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the interval' ) &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then -if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the interval' ) &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then +if ! ( ( echo "$OUT" | grep -q 'Backup is full because of the interval' ) &&( echo "$OUT" | grep -q 'Copied: a' ) && ( echo "$OUT" | grep -q 'Copied: aa' ) && ( echo "$OUT" | grep -q 'Copied: b' ) && ( echo "$OUT" | grep -q 'Copied: c' ) ); then echo "Error backing up 11 dir!" exit 1 fi