1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
4 ;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
9 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
11 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
12 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
13 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
14 ;;; Copyright © 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
15 ;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
16 ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
18 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
19 ;;; Copyright © 2020 Marcin Karpezo <sirmacik@wioo.waw.pl>
21 ;;; This file is part of GNU Guix.
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36 (define-module (gnu packages backup)
37 #:use-module (guix packages)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix git-download)
40 #:use-module (guix download)
41 #:use-module (guix utils)
42 #:use-module (guix build-system cmake)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system go)
45 #:use-module (guix build-system python)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages acl)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages base)
50 #:use-module (gnu packages check)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages crypto)
53 #:use-module (gnu packages databases)
54 #:use-module (gnu packages datastructures)
55 #:use-module (gnu packages dbm)
56 #:use-module (gnu packages dejagnu)
57 #:use-module (gnu packages ftp)
58 #:use-module (gnu packages glib)
59 #:use-module (gnu packages gnupg)
60 #:use-module (gnu packages golang)
61 #:use-module (gnu packages gperf)
62 #:use-module (gnu packages guile)
63 #:use-module (gnu packages linux)
64 #:use-module (gnu packages mcrypt)
65 #:use-module (gnu packages nettle)
66 #:use-module (gnu packages onc-rpc)
67 #:use-module (gnu packages pcre)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages pkg-config)
70 #:use-module (gnu packages protobuf)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages python-crypto)
73 #:use-module (gnu packages python-web)
74 #:use-module (gnu packages python-xyz)
75 #:use-module (gnu packages rsync)
76 #:use-module (gnu packages ssh)
77 #:use-module (gnu packages tls)
78 #:use-module (gnu packages xml))
80 (define-public duplicity
87 (uri (string-append "https://code.launchpad.net/duplicity/"
88 (version-major+minor version)
89 "-series/" version "/+download/duplicity-"
92 (base32 "0ag9dknslxlasslwfjhqgcqbkb1mvzzx93ry7lch2lfzcdd91am6"))))
93 (build-system python-build-system)
95 `(("util-linux" ,util-linux) ; setsid command, for the tests
96 ("par2cmdline" ,par2cmdline)
97 ("python-pexpect" ,python2-pexpect)
98 ("python-fasteners" ,python2-fasteners)
99 ("tzdata" ,tzdata-for-tests)
100 ("mock" ,python2-mock)))
102 `(("lockfile" ,python2-lockfile)
103 ("urllib3" ,python2-urllib3)))
105 `(("librsync" ,librsync-0.9)
107 ("gnupg" ,gnupg) ; gpg executable needed
108 ("util-linux" ,util-linux))) ; for setsid
110 `(#:python ,python-2 ; setup assumes Python 2
113 (modify-phases %standard-phases
114 (add-before 'build 'use-store-file-names
115 (lambda* (#:key inputs #:allow-other-keys)
116 (substitute* "duplicity/gpginterface.py"
117 (("self.call = 'gpg'")
118 (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
120 (substitute* '("testing/functional/__init__.py"
121 "testing/overrides/bin/lftp")
122 (("/bin/sh") (which "sh")))
124 (add-before 'check 'check-setup
125 (lambda* (#:key inputs #:allow-other-keys)
126 (setenv "HOME" (getcwd)) ; gpg needs to write to $HOME
127 (setenv "TZDIR" ; some timestamp checks need TZDIR
128 (string-append (assoc-ref inputs "tzdata")
131 (home-page "http://duplicity.nongnu.org/index.html")
132 (synopsis "Encrypted backup using rsync algorithm")
134 "Duplicity backs up directories by producing encrypted tar-format volumes
135 and uploading them to a remote or local file server. Because duplicity uses
136 librsync, the incremental archives are space efficient and only record the
137 parts of files that have changed since the last backup. Because duplicity
138 uses GnuPG to encrypt and/or sign these archives, they will be safe from
139 spying and/or modification by the server.")
140 (license license:gpl2+)))
142 (define-public par2cmdline
149 (url "https://github.com/Parchive/par2cmdline")
150 (commit (string-append "v" version))))
151 (file-name (git-file-name name version))
154 "0f1jsd5sw2wynjzi7yjqjaf13yhyjfdid91p8yh0jn32y03kjyrz"))))
156 `(("automake" ,automake)
157 ("autoconf" ,autoconf)))
158 (build-system gnu-build-system)
159 (synopsis "File verification and repair tools")
160 (description "Par2cmdline uses Reed-Solomon error-correcting codes to
161 generate and verify PAR2 recovery files. These files can be distributed
162 alongside the source files or stored together with back-ups to protect against
163 transmission errors or @dfn{bit rot}, the degradation of storage media over
165 Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the
166 damage isn't too extensive (and smaller than the size of the recovery file), it
167 can even repair them.")
168 (home-page "https://github.com/Parchive/par2cmdline")
169 (license license:gpl3+)))
178 (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2")
181 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
182 (build-system gnu-build-system)
183 (native-inputs `(("pkg-config" ,pkg-config)))
193 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
195 (home-page (string-append "http://web.archive.org/web/20150925223424/"
196 "http://archive.miek.nl/projects/hdup/index.html"))
197 (synopsis "Simple incremental backup tool")
199 "Hdup2 is a backup utility, its aim is to make backup really simple. The
200 backup scheduling is done by means of a cron job. It supports an
201 include/exclude mechanism, remote backups, encrypted backups and split
202 backups (called chunks) to allow easy burning to CD/DVD.")
203 (license license:gpl2)))
205 (define-public libarchive
212 (uri (list (string-append "https://libarchive.org/downloads/libarchive-"
214 (string-append "https://github.com/libarchive/libarchive"
215 "/releases/download/v" version "/libarchive-"
219 "18dd01ahs2hv74xm7axjc3yhq839p0x0s4vssvlmm8fknja09qfq"))))
220 (build-system gnu-build-system)
228 ("zstd" ,zstd "lib")))
230 `(#:configure-flags '("--disable-static")
232 (modify-phases %standard-phases
233 (add-before 'build 'patch-pwd
235 (substitute* "Makefile"
236 (("/bin/pwd") (which "pwd")))
239 (lambda* (#:key (tests? #t) #:allow-other-keys)
241 ;; XXX: The test_owner_parse, test_read_disk, and
242 ;; test_write_disk_lookup tests expect user 'root' to
243 ;; exist, but the chroot's /etc/passwd doesn't have
244 ;; it. Turn off those tests.
246 ;; XXX: Adjust test that fails with zstd 1.4.1
247 ;; because the default options compresses two bytes
248 ;; better than this test expects.
249 ;; https://github.com/libarchive/libarchive/issues/1226
251 (substitute* "libarchive/test/test_write_filter_zstd.c"
252 (("compression-level\", \"6\"")
253 "compression-level\", \"7\""))
255 ;; The tests allow one to disable tests matching a globbing pattern.
261 ;; XXX: This glob disables too much.
262 (invoke "./libarchive_test" "^test_*_disk*")
263 (invoke "./bsdcpio_test" "^test_owner_parse")
264 (invoke "./bsdtar_test"))
265 ;; Tests may be disabled if cross-compiling.
266 (format #t "Test suite not run.~%"))))
267 (add-after 'install 'add--L-in-libarchive-pc
268 (lambda* (#:key inputs outputs #:allow-other-keys)
269 (let* ((out (assoc-ref outputs "out"))
270 (lib (string-append out "/lib"))
271 (nettle (assoc-ref inputs "nettle"))
272 (libxml2 (assoc-ref inputs "libxml2"))
273 (xz (assoc-ref inputs "xz"))
274 (zlib (assoc-ref inputs "zlib"))
275 (zstd (assoc-ref inputs "zstd"))
276 (bzip2 (assoc-ref inputs "bzip2")))
277 ;; Embed absolute references to these inputs to avoid propagation.
278 (substitute* (list (string-append lib "/pkgconfig/libarchive.pc")
279 (string-append lib "/libarchive.la"))
281 (string-append "-L" nettle "/lib -lnettle"))
283 (string-append "-L" libxml2 "/lib -lxml2"))
285 (string-append "-L" xz "/lib -llzma"))
287 (string-append "-L" zlib "/lib -lz"))
289 (string-append "-L" zstd "/lib -lzstd"))
291 (string-append "-L" bzip2 "/lib -lbz2")))
293 (home-page "https://libarchive.org/")
294 (synopsis "Multi-format archive and compression library")
296 "Libarchive provides a flexible interface for reading and writing
297 archives in various formats such as tar and cpio. Libarchive also supports
298 reading and writing archives compressed using various compression filters such
299 as gzip and bzip2. The library is inherently stream-oriented; readers
300 serially iterate through the archive, writers serially add things to the
301 archive. In particular, note that there is currently no built-in support for
302 random access nor for in-place modification.")
303 (license license:bsd-2)))
313 (url "https://github.com/miekg/rdup")
315 (file-name (git-file-name name version))
317 (base32 "0bzyv6qmnivxnv9nw7lnfn46k0m1dlxcjj53zcva6v8y8084l1iw"))))
318 (build-system gnu-build-system)
320 `(("autoconf" ,autoconf)
321 ("automake" ,automake)
322 ("pkg-config" ,pkg-config)
325 ("dejagnu" ,dejagnu)))
327 ;; XXX Compiling with nettle (encryption) support requires patching out
328 ;; -Werror from GNUmakefile.in. Then, rdup-tr-{en,de}crypt tests fail:
329 ;; free(): invalid pointer
330 ;; ** rdup-tr: SIGPIPE received, exiting
333 ("libarchive" ,libarchive)
336 `(#:parallel-build? #f ;race conditions
338 (modify-phases %standard-phases
339 (add-before 'build 'qualify-inputs
340 (lambda* (#:key inputs #:allow-other-keys)
341 ;; This script is full of pitfalls. Fix some that particularly
342 ;; affect Guix users & leave the rest as reader excercises.
343 (substitute* "rdup-simple"
344 ;; Use the input ‘mcrypt’, not whatever's in $PATH at run time.
345 (("([' ])mcrypt " all delimiter)
346 (string-append delimiter (which "mcrypt") " "))
347 ;; Avoid frivolous dependency on ‘which’ with a shell builtin.
348 (("which") "command -v"))
350 (add-before 'check 'disable-encryption-tests
352 (for-each delete-file
353 (list "testsuite/rdup/rdup.rdup-tr-crypt.exp"
354 "testsuite/rdup/rdup.rdup-tr-decrypt.exp"
355 "testsuite/rdup/rdup.rdup-tr-encrypt.exp"))
357 (add-before 'check 'pre-check
359 (setenv "HOME" (getcwd))
360 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
361 (("/bin/cat") (which "cat")))
363 (home-page "https://github.com/miekg/rdup")
364 (synopsis "Provide a list of files to backup")
366 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
367 Rdup itself does not backup anything, it only print a list of absolute
368 file names to standard output. Auxiliary scripts are needed that act on this
369 list and implement the backup strategy.")
370 (license license:gpl3+)))
379 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
380 "btar-" version ".tar.gz"))
383 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
384 (build-system gnu-build-system)
386 `(("librsync" ,librsync-0.9)))
388 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
390 #:tests? #f ;test input not distributed
392 ;; no configure phase
393 (modify-phases %standard-phases
394 (delete 'configure))))
395 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
396 (synopsis "Tar-compatible archiver")
398 "Btar is a tar-compatible archiver which allows arbitrary compression and
399 ciphering, redundancy, differential backup, indexed extraction, multicore
400 compression, input and output serialisation, and tolerance to partial archive
402 (license license:gpl3+)))
404 (define-public rdiff-backup
406 (name "rdiff-backup")
411 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
415 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
416 (build-system python-build-system)
418 `(("python" ,python-2)
419 ("librsync" ,librsync-0.9)))
423 (home-page "https://www.nongnu.org/rdiff-backup/")
424 (synopsis "Local/remote mirroring+incremental backup")
426 "Rdiff-backup backs up one directory to another, possibly over a network.
427 The target directory ends up a copy of the source directory, but extra reverse
428 diffs are stored in a special subdirectory of that target directory, so you
429 can still recover files lost some time ago. The idea is to combine the best
430 features of a mirror and an incremental backup. Rdiff-backup also preserves
431 subdirectories, hard links, dev files, permissions, uid/gid ownership,
432 modification times, extended attributes, acls, and resource forks. Also,
433 rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
434 rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
435 to a remote location, and only the differences will be transmitted. Finally,
436 rdiff-backup is easy to use and settings have sensible defaults.")
437 (license license:gpl2+)))
439 (define-public rsnapshot
447 "https://github.com/rsnapshot/rsnapshot/releases/download/"
448 version "/rsnapshot-" version ".tar.gz"))
450 (base32 "1lavqmmsf53pim0nvming7fkng6p0nk2a51k2c2jdq0l7snpl31b"))))
451 (build-system gnu-build-system)
454 (modify-phases %standard-phases
457 (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
458 "t/backup_exec/conf/backup_exec_fail.conf"
459 "t/backup_exec/conf/backup_exec.conf")
460 (("/bin/true") (which "true"))
461 (("/bin/false") (which "false")))
463 ;; Disable a test that tries to connect to localhost on port 22.
464 (delete-file "t/ssh_args/ssh_args.t.in")
466 (invoke "make" "test"))))))
470 (home-page "https://rsnapshot.org")
471 (synopsis "Deduplicating snapshot backup utility based on rsync")
472 (description "rsnapshot is a file system snapshot utility based on rsync.
473 rsnapshot makes it easy to make periodic snapshots of local machines, and
474 remote machines over SSH. To reduce the disk space required for each backup,
475 rsnapshot uses hard links to deduplicate identical files.")
476 (license license:gpl2+)))
478 (define-public libchop
484 (uri (string-append "mirror://savannah/libchop/libchop-"
488 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
489 (patches (search-patches "diffutils-gets-undeclared.patch"))
490 (modules '((guix build utils)))
493 ;; Include all the libtirpc headers necessary to get the
494 ;; definitions of 'u_int', etc.
495 (substitute* '("src/block-server.c"
496 "include/chop/block-server.h"
497 "utils/chop-block-server.c")
498 (("#include <rpc/(.*)\\.h>" _ header)
499 (string-append "#include <rpc/types.h>\n"
500 "#include <rpc/rpc.h>\n"
501 "#include <rpc/" header ".h>\n")))
503 (build-system gnu-build-system)
505 '(;; Link against libtirpc.
506 #:configure-flags '("LDFLAGS=-ltirpc -Wl,--as-needed")
508 #:phases (modify-phases %standard-phases
509 (add-before 'configure 'adjust-configure-script
511 ;; Mimic upstream commit
512 ;; 25750ab5ef82fd3cfce5205d5f1ef07b47098091.
513 (substitute* "configure"
514 (("GUILE=(.*)--variable bindir`" _ middle)
515 (string-append "GUILE=" middle
516 "--variable bindir`/guile")))
518 (add-before 'build 'set-libtirpc-include-path
519 (lambda* (#:key inputs #:allow-other-keys)
520 ;; Allow <rpc/rpc.h> & co. to be found.
521 (let ((libtirpc (assoc-ref inputs "libtirpc")))
523 (string-append (getenv "CPATH")
527 (add-before 'check 'skip-test
529 ;; XXX: This test fails (1) because current GnuTLS no
530 ;; longer supports OpenPGP authentication, and (2) for
531 ;; some obscure reason. Better skip it.
532 (setenv "XFAIL_TESTS" "utils/block-server")
535 `(("guile" ,guile-2.0)
536 ("gperf" ,gperf-3.0) ;see <https://bugs.gnu.org/32382>
537 ("pkg-config" ,pkg-config)
538 ("rpcsvc-proto" ,rpcsvc-proto))) ;for 'rpcgen'
540 `(("guile" ,guile-2.0)
541 ("util-linux" ,util-linux)
542 ("libtirpc" ,libtirpc)
547 ("libgcrypt" ,libgcrypt)
551 (home-page "https://nongnu.org/libchop/")
552 (synopsis "Tools & library for data backup and distributed storage")
554 "Libchop is a set of utilities and library for data backup and
555 distributed storage. Its main application is @command{chop-backup}, an
556 encrypted backup program that supports data integrity checks, versioning,
557 distribution among several sites, selective sharing of stored data, adaptive
558 compression, and more. The library itself implements storage techniques such
559 as content-addressable storage, content hash keys, Merkle trees, similarity
560 detection, and lossless compression.")
561 (license license:gpl3+)))
570 (uri (pypi-uri "borgbackup" version))
572 (base32 "089q3flmwbz7dc28zlscwylf64kgck3jf1n6lqpwww8hlrk8cjhn"))
573 (modules '((guix build utils)))
576 ;; Delete files generated by Cython. We used to have a regex
577 ;; that created the list of generated files but Borg has
578 ;; added new non-generated C files that cause the regex to
579 ;; generate the wrong list.
580 (for-each delete-file
581 '("src/borg/algorithms/checksums.c"
583 "src/borg/compress.c"
584 "src/borg/crypto/low_level.c"
585 "src/borg/hashindex.c"
587 "src/borg/platform/darwin.c"
588 "src/borg/platform/freebsd.c"
589 "src/borg/platform/linux.c"
590 "src/borg/platform/posix.c"))
591 ;; Remove bundled shared libraries.
592 (with-directory-excursion "src/borg/algorithms"
593 (for-each delete-file-recursively
594 (list "blake2" "lz4" "msgpack" "zstd")))
595 ;; Purge some msgpack references from setup.py or the resulting
596 ;; sources will be unbuildable.
597 (substitute* "setup.py"
598 ((".*Extension\\('borg\\.algorithms\\.msgpack\\..*") "")
599 (("msgpack_packer_source, msgpack_unpacker_source") ""))
601 (build-system python-build-system)
603 `(#:modules ((srfi srfi-26) ; for cut
605 (guix build python-build-system))
607 (modify-phases %standard-phases
608 (add-after 'unpack 'set-env
609 (lambda* (#:key inputs #:allow-other-keys)
610 (let ((openssl (assoc-ref inputs "openssl"))
611 (libb2 (assoc-ref inputs "libb2"))
612 (lz4 (assoc-ref inputs "lz4"))
613 (zstd (assoc-ref inputs "zstd")))
614 (setenv "BORG_OPENSSL_PREFIX" openssl)
615 (setenv "BORG_LIBB2_PREFIX" libb2)
616 (setenv "BORG_LIBLZ4_PREFIX" lz4)
617 (setenv "BORG_LIBZSTD_PREFIX" zstd)
618 (setenv "PYTHON_EGG_CACHE" "/tmp")
619 ;; The test 'test_return_codes[python]' fails when
620 ;; HOME=/homeless-shelter.
621 (setenv "HOME" "/tmp")
623 (add-after 'unpack 'use-system-msgpack
625 (substitute* "src/borg/helpers.py"
626 (("prefer_system_msgpack = False")
627 "prefer_system_msgpack = True"))
629 ;; The tests need to be run after Borg is installed.
631 (add-after 'install 'check
632 (lambda* (#:key inputs outputs #:allow-other-keys)
633 ;; Make the installed package available for the test suite.
634 (add-installed-pythonpath inputs outputs)
635 ;; The tests should be run in an empty directory.
637 (with-directory-excursion "tests"
638 (invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
640 ;; These tests need to write to '/var'.
641 "not test_get_cache_dir "
642 "and not test_get_config_dir "
643 "and not test_get_keys_dir "
644 "and not test_get_security_dir "
645 ;; These tests assume there is a root user in
647 "and not test_access_acl "
648 "and not test_default_acl "
649 "and not test_non_ascii_acl "
650 ;; This test needs the unpackaged pytest-benchmark.
652 ;; These tests assume the kernel supports FUSE.
654 "and not test_fuse_allow_damaged_files "
655 "and not test_mount_hardlinks "
656 "and not test_readonly_mount ")))))
657 (add-after 'install 'install-doc
658 (lambda* (#:key inputs outputs #:allow-other-keys)
659 (let* ((out (assoc-ref outputs "out"))
660 (man (string-append out "/share/man/man1"))
661 (misc (string-append out "/share/borg/misc")))
662 (for-each (cut install-file <> misc)
663 '("docs/misc/create_chunker-params.txt"
664 "docs/misc/internals-picture.txt"
665 "docs/misc/prune-example.txt"))
666 (copy-recursively "docs/man" man)
669 `(("python-cython" ,python-cython)
670 ("python-setuptools-scm" ,python-setuptools-scm)
671 ("python-pytest" ,python-pytest)))
677 ("python-llfuse" ,python-llfuse)
678 ;; The Python msgpack library changed its name so Borg requires this
679 ;; transitional package for now:
680 ;; <https://bugs.gnu.org/30662>
681 ("python-msgpack" ,python-msgpack-transitional)
682 ("zstd" ,zstd "lib")))
683 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
684 (description "Borg is a deduplicating backup program. Optionally, it
685 supports compression and authenticated encryption. The main goal of Borg is to
686 provide an efficient and secure way to backup data. The data deduplication
687 technique used makes Borg suitable for daily backups since only changes are
688 stored. The authenticated encryption technique makes it suitable for backups
689 to not fully trusted targets. Borg is a fork of Attic.")
690 (home-page "https://www.borgbackup.org/")
691 (license license:bsd-3)))
699 (uri (pypi-uri "Attic" version))
702 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
703 (build-system python-build-system)
705 `(;; The tests assume they are run as root:
706 ;; https://github.com/jborg/attic/issues/7
709 (modify-phases %standard-phases
711 'build 'set-openssl-prefix
712 (lambda* (#:key inputs #:allow-other-keys)
713 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
718 ("python-msgpack" ,python-msgpack)
720 ;; Attic is probably incompatible with llfuse > 0.41.
721 ;; These links are to discussions of llfuse compatibility from
722 ;; the borg project. Borg is a recent fork of attic, and attic
723 ;; has not been updated since the fork, so it's likely that
724 ;; llfuse compatibility requirements are still the same.
725 ;; https://github.com/borgbackup/borg/issues/642
726 ;; https://github.com/borgbackup/borg/issues/643
727 ("python-llfuse" ,python-llfuse-0.41)))
728 (synopsis "Deduplicating backup program")
729 (description "Attic is a deduplicating backup program. The main goal of
730 Attic is to provide an efficient and secure way to backup data. The data
731 deduplication technique used makes Attic suitable for daily backups since only
732 changes are stored.")
733 (home-page "https://attic-backup.org/")
734 (license license:bsd-3)
735 (properties `((superseded . ,borg)))))
737 (define-public wimlib
743 (uri (string-append "https://wimlib.net/downloads/"
744 "wimlib-" version ".tar.gz"))
747 "0id9ym3hzij4kpdrk0sz3ijxp5r0z1md5jch83pml9hdy1zbx5bj"))))
748 (build-system gnu-build-system)
750 `(("pkg-config" ,pkg-config)))
755 ("openssl" ,openssl)))
757 `(#:configure-flags (list "--enable-test-support")))
758 (home-page "https://wimlib.net/")
759 (synopsis "WIM file manipulation library and utilities")
760 (description "wimlib is a C library and set of command-line utilities for
761 creating, modifying, extracting, and mounting archives in the Windows Imaging
762 Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
763 NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
764 ;; wimlib is dual-licenced under version 3 or later of either the GPL or
765 ;; LGPL, except those files explicitly marked as being released into the
766 ;; public domain (CC0) in their headers.
767 (license (list license:gpl3+
771 (define-public dirvish
775 (build-system gnu-build-system)
779 "http://dirvish.org/dirvish-" version ".tgz"))
782 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
784 `(#:modules ((ice-9 match) (ice-9 rdelim)
785 ,@%gnu-build-system-modules)
787 ;; This mostly mirrors the steps taken in the install.sh that ships
788 ;; with dirvish, but simplified because we aren't prompting interactively
789 (modify-phases %standard-phases
794 (lambda* (#:key inputs outputs #:allow-other-keys)
795 ;; These are mostly the same steps the install.sh that comes with
797 (let* (;; Files we'll be copying
799 '("dirvish" "dirvish-runall"
800 "dirvish-expire" "dirvish-locate"))
802 '(("dirvish" "8") ("dirvish-runall" "8")
803 ("dirvish-expire" "8") ("dirvish-locate" "8")
804 ("dirvish.conf" "5")))
807 (assoc-ref outputs "out"))
809 ;; Just a default... not so useful on guixsd though
810 ;; You probably want to a service with file(s) to point to.
811 (confdir "/etc/dirvish")
813 (perl (string-append (assoc-ref %build-inputs "perl")
815 (loadconfig.pl (call-with-input-file "loadconfig.pl"
819 (define (write-pl filename)
821 (string-append "#!" perl "\n\n"
822 "$CONFDIR = \"" confdir "\";\n\n"))
823 (define input-file-location
824 (string-append filename ".pl"))
825 (define target-file-location
826 (string-append output-dir "/bin/" filename ".pl"))
827 (define text-to-write
828 (string-append pl-header
829 (call-with-input-file input-file-location
832 (with-output-to-file target-file-location
834 (display text-to-write)))
835 (chmod target-file-location #o755)
836 (wrap-program target-file-location
837 `("PERL5LIB" ":" prefix
838 ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
839 "/lib/perl5/site_perl"))
840 '("perl-libtime-period"
841 "perl-libtime-parsedate")))))
847 (string-append file-base "." man-num))
849 (string-append output-dir
850 "/share/man/man" man-num
852 (copy-file filename output-path)))))
855 (mkdir-p (string-append output-dir "/bin/"))
856 (mkdir-p (string-append output-dir "/share/man/man8/"))
857 (mkdir-p (string-append output-dir "/share/man/man5/"))
859 ;; Write out executables
860 (for-each write-pl executables)
861 ;; Write out man pages
862 (for-each write-man man-pages)
867 ("perl-libtime-period" ,perl-libtime-period)
868 ("perl-libtime-parsedate" ,perl-libtime-parsedate)))
869 (home-page "http://dirvish.org/")
870 (synopsis "Fast, disk based, rotating network backup system")
872 "With dirvish you can maintain a set of complete images of your
873 file systems with unattended creation and expiration. A dirvish backup vault
874 is like a time machine for your data. ")
875 (license (license:fsf-free "file://COPYING"
876 "Open Software License 2.0"))))
878 (define-public restic
882 ;; TODO Try packaging the bundled / vendored dependencies in the 'vendor/'
887 "https://github.com/restic/restic/releases/download/"
888 "v" version "/restic-" version ".tar.gz"))
889 (file-name (string-append name "-" version ".tar.gz"))
892 "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w"))))
893 (build-system go-build-system)
895 `(#:import-path "github.com/restic/restic"
896 ;; We don't need to install the source code for end-user applications.
899 (modify-phases %standard-phases
901 (lambda* (#:key inputs #:allow-other-keys)
902 (with-directory-excursion "src/github.com/restic/restic"
903 ;; Disable 'restic self-update'. It makes little sense in Guix.
904 (substitute* "build.go" (("selfupdate") ""))
905 (setenv "HOME" (getcwd)) ; for $HOME/.cache/go-build
906 (invoke "go" "run" "build.go"))))
910 (with-directory-excursion "src/github.com/restic/restic"
911 ;; Disable FUSE tests.
912 (setenv "RESTIC_TEST_FUSE" "0")
913 (invoke "go" "run" "build.go" "--test"))))
916 (lambda* (#:key outputs #:allow-other-keys)
917 (let ((out (assoc-ref outputs "out"))
918 (src "src/github.com/restic/restic"))
919 (install-file (string-append src "/restic")
920 (string-append out "/bin"))
923 (add-after 'install 'install-docs
924 (lambda* (#:key outputs #:allow-other-keys)
925 (let* ((out (assoc-ref outputs "out"))
927 (man-section (string-append man "/man"))
928 (src "src/github.com/restic/restic/doc/man/"))
929 ;; Install all the man pages to "out".
933 (string-append out man-section
934 (string-take-right file 1))))
935 (find-files src "\\.[1-9]"))
938 (add-after 'install-docs 'install-shell-completion
939 (lambda* (#:key outputs #:allow-other-keys)
940 (let* ((out (assoc-ref outputs "out"))
941 (bin (string-append out "/bin"))
942 (etc (string-append out "/etc"))
943 (share (string-append out "/share")))
946 (let* ((shell-name (symbol->string shell))
947 (dir (string-append "etc/completion/" shell-name)))
949 (invoke (string-append bin "/restic") "generate"
950 (string-append "--" shell-name "-completion")
951 (string-append dir "/"
954 ((zsh) "_restic"))))))
956 (with-directory-excursion "etc/completion"
957 (install-file "bash/restic"
958 (string-append etc "/bash_completion.d"))
959 (install-file "zsh/_restic"
960 (string-append share "/zsh/site-functions")))
962 (home-page "https://restic.net/")
963 (synopsis "Backup program with multiple revisions, encryption and more")
964 (description "Restic is a program that does backups right and was designed
965 with the following principles in mind:
968 @item Easy: Doing backups should be a frictionless process, otherwise you
969 might be tempted to skip it. Restic should be easy to configure and use, so
970 that, in the event of a data loss, you can just restore it. Likewise,
971 restoring data should not be complicated.
973 @item Fast: Backing up your data with restic should only be limited by your
974 network or hard disk bandwidth so that you can backup your files every day.
975 Nobody does backups if it takes too much time. Restoring backups should only
976 transfer data that is needed for the files that are to be restored, so that
977 this process is also fast.
979 @item Verifiable: Much more important than backup is restore, so restic
980 enables you to easily verify that all data can be restored. @item Secure:
981 Restic uses cryptography to guarantee confidentiality and integrity of your
982 data. The location the backup data is stored is assumed not to be a trusted
983 environment (e.g. a shared space where others like system administrators are
984 able to access your backups). Restic is built to secure your data against
987 @item Efficient: With the growth of data, additional snapshots should only
988 take the storage of the actual increment. Even more, duplicate data should be
989 de-duplicated before it is actually written to the storage back end to save
990 precious backup space.
992 (license license:bsd-2)))
994 (define-public zbackup
1002 (url "https://github.com/zbackup/zbackup")
1004 (file-name (git-file-name name version))
1006 (base32 "14l1kyxg7pccpax3d6qcpmdycb70kn3fxp1a59w64hqy2493hngl"))))
1007 (build-system cmake-build-system)
1009 `(#:tests? #f)) ;no test
1012 ("libressl" ,libressl)
1013 ("protobuf" ,protobuf)
1016 (home-page "http://zbackup.org")
1017 (synopsis "Versatile deduplicating backup tool")
1019 "ZBackup is a globally-deduplicating backup tool, based on the
1020 ideas found in Rsync. Feed a large @file{.tar} into it, and it will
1021 store duplicate regions of it only once, then compress and optionally
1022 encrypt the result. Feed another @file{.tar} file, and it will also
1023 re-use any data found in any previous backups. This way only new
1024 changes are stored, and as long as the files are not very different,
1025 the amount of storage required is very low. Any of the backup files
1026 stored previously can be read back in full at any time. The program
1027 is format-agnostic, so you can feed virtually any files to it.")
1028 (license license:gpl2+)))
1037 (uri (string-append "mirror://sourceforge/dump/dump/"
1038 version "/dump-" version ".tar.gz"))
1041 "15rg5y15ak0ppqlhcih78layvg7cwp6hc16p3c58xs8svlkxjqc0"))))
1042 (build-system gnu-build-system)
1045 `("--sysconfdir=/etc"
1046 "--disable-readline"
1049 `(("pkg-config" ,pkg-config)))
1051 `(("openssl" ,openssl-1.0)
1053 ("util-linux" ,util-linux "lib")
1054 ("e2fsprogs" ,e2fsprogs)))
1055 (home-page "https://dump.sourceforge.io/")
1056 (synopsis "Ext2/3/4 file system dump/restore utilities")
1057 (description "Dump examines files in a file system, determines which ones
1058 need to be backed up, and copies those files to a specified disk, tape or
1059 other storage medium. Subsequent incremental backups can then be layered on
1060 top of the full backup. The restore command performs the inverse function of
1061 dump; it can restore a full backup of a file system. Single files and
1062 directory subtrees may also be restored from full or partial backups in
1063 interractive mode.")
1064 (license license:bsd-3)))
1072 (uri (string-append "mirror://sourceforge/burp/burp-" version
1073 "/burp-" version ".tar.bz2"))
1076 "18f8cjsb87skabvz4cl5pdln35qmim7x686js1xzpld6wyl9kv2k"))))
1077 (build-system gnu-build-system)
1080 (modify-phases %standard-phases
1081 (add-before 'check 'extend-test-time-outs
1082 ;; The defaults are far too low for busy boxes & spinning storage.
1084 (substitute* (find-files "utest" "\\.c$")
1085 (("(tcase_set_timeout\\(tc_core,)[ 0-9]*(\\);.*)$" _ prefix suffix)
1086 (string-append prefix " 3600" suffix "\n")))
1089 `(("librsync" ,librsync)
1090 ("openssl" ,openssl)
1095 ("pkg-config" ,pkg-config)))
1096 (home-page "https://burp.grke.org")
1097 (synopsis "Differential backup and restore")
1098 (description "Burp is a network backup and restore program. It attempts
1099 to reduce network traffic and the amount of space that is used by each
1101 (license license:agpl3)))