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 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>
15 ;;; This file is part of GNU Guix.
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30 (define-module (gnu packages backup)
31 #:use-module (guix packages)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix download)
34 #:use-module (guix utils)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system go)
37 #:use-module (guix build-system python)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages acl)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages crypto)
45 #:use-module (gnu packages databases)
46 #:use-module (gnu packages dejagnu)
47 #:use-module (gnu packages ftp)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages gnupg)
50 #:use-module (gnu packages golang)
51 #:use-module (gnu packages gperf)
52 #:use-module (gnu packages guile)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages mcrypt)
55 #:use-module (gnu packages nettle)
56 #:use-module (gnu packages pcre)
57 #:use-module (gnu packages perl)
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages python)
60 #:use-module (gnu packages python-crypto)
61 #:use-module (gnu packages python-web)
62 #:use-module (gnu packages rsync)
63 #:use-module (gnu packages ssh)
64 #:use-module (gnu packages tls)
65 #:use-module (gnu packages xml))
67 (define-public duplicity
74 (uri (string-append "https://code.launchpad.net/duplicity/"
75 (version-major+minor version)
76 "-series/" version "/+download/duplicity-"
80 "0jmh3h09680xyf33hzxxxl74bwz66zqhzvjlj7j89r9rz3qwa91p"))))
81 (build-system python-build-system)
83 `(("util-linux" ,util-linux) ;setsid command, for the tests
84 ("par2cmdline" ,par2cmdline)
85 ("python-pexpect" ,python2-pexpect)
86 ("python-fasteners" ,python2-fasteners)
87 ("mock" ,python2-mock)))
89 `(("lockfile" ,python2-lockfile)
90 ("urllib3" ,python2-urllib3)))
92 `(("librsync" ,librsync)
94 ("gnupg" ,gnupg) ;gpg executable needed
95 ("util-linux" ,util-linux) ;for setsid
98 `(#:python ,python-2 ;setup assumes Python 2
101 (modify-phases %standard-phases
102 (add-before 'build 'patch-source
103 (lambda* (#:key inputs #:allow-other-keys)
104 ;; embed gpg store name
105 (substitute* "duplicity/gpginterface.py"
106 (("self.call = 'gpg'")
107 (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
108 (substitute* '("testing/functional/__init__.py"
109 "testing/overrides/bin/lftp")
110 (("/bin/sh") (which "sh")))
112 (add-before 'check 'check-setup
113 (lambda* (#:key inputs #:allow-other-keys)
114 (setenv "HOME" (getcwd)) ;gpg needs to write to $HOME
115 (setenv "TZDIR" ;some timestamp checks need TZDIR
116 (string-append (assoc-ref inputs "tzdata")
119 (home-page "http://duplicity.nongnu.org/index.html")
120 (synopsis "Encrypted backup using rsync algorithm")
122 "Duplicity backs up directories by producing encrypted tar-format volumes
123 and uploading them to a remote or local file server. Because duplicity uses
124 librsync, the incremental archives are space efficient and only record the
125 parts of files that have changed since the last backup. Because duplicity
126 uses GnuPG to encrypt and/or sign these archives, they will be safe from
127 spying and/or modification by the server.")
128 (license license:gpl2+)))
130 (define-public par2cmdline
136 (uri (string-append "https://github.com/Parchive/par2cmdline/archive/v"
138 (file-name (string-append name "-" version ".tar.gz"))
141 "1jpshmmcr81mxly0md2rr231qz9c8c680bbvcmhh100dg9i4a6s6"))))
143 `(("automake" ,automake)
144 ("autoconf" ,autoconf)))
145 (build-system gnu-build-system)
148 (modify-phases %standard-phases
149 (add-after 'unpack 'autoreconf
150 (lambda _ (invoke "autoreconf" "-vfi"))))))
151 (synopsis "File verification and repair tools")
152 (description "Par2cmdline uses Reed-Solomon error-correcting codes to
153 generate and verify PAR2 recovery files. These files can be distributed
154 alongside the source files or stored together with back-ups to protect against
155 transmission errors or @dfn{bit rot}, the degradation of storage media over
157 Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the
158 damage isn't too extensive (and smaller than the size of the recovery file), it
159 can even repair them.")
160 (home-page "https://github.com/Parchive/par2cmdline")
161 (license license:gpl3+)))
170 (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2")
173 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
174 (build-system gnu-build-system)
175 (native-inputs `(("pkg-config" ,pkg-config)))
185 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
187 (home-page "http://archive.miek.nl/projects/hdup/index.html")
188 (synopsis "Simple incremental backup tool")
190 "Hdup2 is a backup utility, its aim is to make backup really simple. The
191 backup scheduling is done by means of a cron job. It supports an
192 include/exclude mechanism, remote backups, encrypted backups and split
193 backups (called chunks) to allow easy burning to CD/DVD.")
194 (license license:gpl2)))
196 (define-public libarchive
203 (uri (string-append "http://libarchive.org/downloads/libarchive-"
205 (patches (search-patches "libarchive-CVE-2017-14166.patch"
206 "libarchive-CVE-2017-14502.patch"))
209 "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))
210 (build-system gnu-build-system)
220 (modify-phases %standard-phases
221 (add-before 'build 'patch-pwd
223 (substitute* "Makefile"
224 (("/bin/pwd") (which "pwd")))
228 ;; XXX: The test_owner_parse, test_read_disk, and
229 ;; test_write_disk_lookup tests expect user 'root' to exist, but
230 ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
232 ;; The tests allow one to disable tests matching a globbing pattern.
233 (invoke "make" "libarchive_test" "bsdcpio_test" "bsdtar_test")
234 ;; XXX: This glob disables too much.
235 (invoke "./libarchive_test" "^test_*_disk*")
236 (invoke "./bsdcpio_test" "^test_owner_parse")
237 (invoke "./bsdtar_test")))
238 (add-after 'install 'add--L-in-libarchive-pc
239 (lambda* (#:key inputs outputs #:allow-other-keys)
240 (let* ((out (assoc-ref outputs "out"))
241 (lib (string-append out "/lib"))
242 (nettle (assoc-ref inputs "nettle"))
243 (libxml2 (assoc-ref inputs "libxml2"))
244 (xz (assoc-ref inputs "xz"))
245 (zlib (assoc-ref inputs "zlib"))
246 (bzip2 (assoc-ref inputs "bzip2")))
247 (substitute* (string-append lib "/pkgconfig/libarchive.pc")
249 (string-append "-L" nettle "/lib -lnettle"))
251 (string-append "-L" libxml2 "/lib -lxml2"))
253 (string-append "-L" xz "/lib -llzma"))
255 (string-append "-L" zlib "/lib -lz"))
257 (string-append "-L" bzip2 "/lib -lbz2")))
260 ;; libarchive/test/test_write_format_gnutar_filenames.c needs to be
261 ;; compiled with C99 or C11 or a gnu variant.
262 #:configure-flags '("CFLAGS=-O2 -g -std=c99")))
263 (home-page "http://libarchive.org/")
264 (synopsis "Multi-format archive and compression library")
266 "Libarchive provides a flexible interface for reading and writing
267 archives in various formats such as tar and cpio. Libarchive also supports
268 reading and writing archives compressed using various compression filters such
269 as gzip and bzip2. The library is inherently stream-oriented; readers
270 serially iterate through the archive, writers serially add things to the
271 archive. In particular, note that there is currently no built-in support for
272 random access nor for in-place modification.")
273 (license license:bsd-2)))
282 (file-name (string-append name "-" version ".tar.gz"))
283 (uri (string-append "https://github.com/miekg/rdup/archive/"
287 "1jr91hgcf0rrpanqlwws72ql9db6d6grs2i122ki1s4bx0vqqyvq"))))
288 (build-system gnu-build-system)
290 `(("autoconf" ,autoconf)
291 ("automake" ,automake)
292 ("pkg-config" ,pkg-config)
295 ("dejagnu" ,dejagnu)))
299 ("libarchive" ,libarchive)
303 `(#:parallel-build? #f ;race conditions
305 (modify-phases %standard-phases
306 (add-before 'build 'qualify-inputs
307 (lambda* (#:key inputs #:allow-other-keys)
308 ;; This script is full of pitfalls. Fix some that particularly
309 ;; affect Guix users & leave the rest as reader excercises.
310 (substitute* "rdup-simple"
311 ;; Use the input ‘mcrypt’, not whatever's in $PATH at run time.
312 (("([' ])mcrypt " all delimiter)
313 (string-append delimiter (which "mcrypt") " "))
314 ;; Avoid frivolous dependency on ‘which’ with a shell builtin.
315 (("which") "command -v"))
317 (add-before 'check 'pre-check
319 (setenv "HOME" (getcwd))
320 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
321 (("/bin/cat") (which "cat")))
323 (home-page "https://github.com/miekg/rdup")
324 (synopsis "Provide a list of files to backup")
326 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
327 Rdup itself does not backup anything, it only print a list of absolute
328 file names to standard output. Auxiliary scripts are needed that act on this
329 list and implement the backup strategy.")
330 (license license:gpl3+)))
339 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
340 "btar-" version ".tar.gz"))
343 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
344 (build-system gnu-build-system)
346 `(("librsync" ,librsync)))
348 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
350 #:tests? #f ;test input not distributed
352 ;; no configure phase
353 (modify-phases %standard-phases
354 (delete 'configure))))
355 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
356 (synopsis "Tar-compatible archiver")
358 "Btar is a tar-compatible archiver which allows arbitrary compression and
359 ciphering, redundancy, differential backup, indexed extraction, multicore
360 compression, input and output serialisation, and tolerance to partial archive
362 (license license:gpl3+)))
364 (define-public rdiff-backup
366 (name "rdiff-backup")
371 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
375 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
376 (build-system python-build-system)
378 `(("python" ,python-2)
379 ("librsync" ,librsync)))
383 (home-page "https://www.nongnu.org/rdiff-backup/")
384 (synopsis "Local/remote mirroring+incremental backup")
386 "Rdiff-backup backs up one directory to another, possibly over a network.
387 The target directory ends up a copy of the source directory, but extra reverse
388 diffs are stored in a special subdirectory of that target directory, so you
389 can still recover files lost some time ago. The idea is to combine the best
390 features of a mirror and an incremental backup. Rdiff-backup also preserves
391 subdirectories, hard links, dev files, permissions, uid/gid ownership,
392 modification times, extended attributes, acls, and resource forks. Also,
393 rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
394 rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
395 to a remote location, and only the differences will be transmitted. Finally,
396 rdiff-backup is easy to use and settings have sensible defaults.")
397 (license license:gpl2+)))
399 (define-public rsnapshot
407 "https://github.com/rsnapshot/rsnapshot/releases/download/"
408 version "/rsnapshot-" version ".tar.gz"))
411 "05jfy99a0xs6lvsjfp3wz21z0myqhmwl2grn3jr9clijbg282ah4"))))
412 (build-system gnu-build-system)
415 (modify-phases %standard-phases
418 (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
419 "t/backup_exec/conf/backup_exec_fail.conf"
420 "t/backup_exec/conf/backup_exec.conf")
421 (("/bin/true") (which "true"))
422 (("/bin/false") (which "false")))
423 (invoke "make" "test"))))))
427 (home-page "http://rsnapshot.org")
428 (synopsis "Deduplicating snapshot backup utility based on rsync")
429 (description "rsnapshot is a file system snapshot utility based on rsync.
430 rsnapshot makes it easy to make periodic snapshots of local machines, and
431 remote machines over SSH. To reduce the disk space required for each backup,
432 rsnapshot uses hard links to deduplicate identical files.")
433 (license license:gpl2+)))
435 (define-public libchop
441 (uri (string-append "mirror://savannah/libchop/libchop-"
445 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
446 (patches (search-patches "diffutils-gets-undeclared.patch"))))
447 (build-system gnu-build-system)
449 `(("guile" ,guile-2.0)
451 ("pkg-config" ,pkg-config)))
453 `(("guile" ,guile-2.0)
454 ("util-linux" ,util-linux)
459 ("libgcrypt" ,libgcrypt)
463 (home-page "https://nongnu.org/libchop/")
464 (synopsis "Tools & library for data backup and distributed storage")
466 "Libchop is a set of utilities and library for data backup and
467 distributed storage. Its main application is @command{chop-backup}, an
468 encrypted backup program that supports data integrity checks, versioning,
469 distribution among several sites, selective sharing of stored data, adaptive
470 compression, and more. The library itself implements storage techniques such
471 as content-addressable storage, content hash keys, Merkle trees, similarity
472 detection, and lossless compression.")
473 (license license:gpl3+)))
482 (uri (pypi-uri "borgbackup" version))
484 (base32 "0c09j46fi8i7klas0bh82a4whlwnajshk0izkgax6fjxr1sf9lm1"))
485 (modules '((guix build utils)))
488 (for-each delete-file
489 (find-files "borg" "^(c|h|p).*\\.c$"))
490 ;; Remove bundled shared libraries.
491 (with-directory-excursion "src/borg/algorithms"
492 (for-each delete-file-recursively
493 (list "blake2" "lz4" "zstd")))
495 (build-system python-build-system)
497 `(#:modules ((srfi srfi-26) ; for cut
499 (guix build python-build-system))
501 (modify-phases %standard-phases
502 (add-after 'unpack 'set-env
503 (lambda* (#:key inputs #:allow-other-keys)
504 (let ((openssl (assoc-ref inputs "openssl"))
505 (libb2 (assoc-ref inputs "libb2"))
506 (lz4 (assoc-ref inputs "lz4"))
507 (zstd (assoc-ref inputs "zstd")))
508 (setenv "BORG_OPENSSL_PREFIX" openssl)
509 (setenv "BORG_LIBB2_PREFIX" libb2)
510 (setenv "BORG_LIBLZ4_PREFIX" lz4)
511 (setenv "BORG_LIBZSTD_PREFIX" zstd)
512 (setenv "PYTHON_EGG_CACHE" "/tmp")
513 ;; The test 'test_return_codes[python]' fails when
514 ;; HOME=/homeless-shelter.
515 (setenv "HOME" "/tmp")
517 ;; The tests need to be run after Borg is installed.
519 (add-after 'install 'check
520 (lambda* (#:key inputs outputs #:allow-other-keys)
521 ;; Make the installed package available for the test suite.
522 (add-installed-pythonpath inputs outputs)
523 ;; The tests should be run in an empty directory.
525 (with-directory-excursion "tests"
526 (invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
528 ;; These tests need to write to '/var'.
529 "not test_get_cache_dir "
530 "and not test_get_config_dir "
531 "and not test_get_keys_dir "
532 "and not test_get_security_dir "
533 ;; These tests assume there is a root user in
535 "and not test_access_acl "
536 "and not test_default_acl "
537 "and not test_non_ascii_acl "
538 ;; This test needs the unpackaged pytest-benchmark.
540 ;; These tests assume the kernel supports FUSE.
542 "and not test_fuse_allow_damaged_files "
543 "and not test_mount_hardlinks")))))
544 (add-after 'install 'install-doc
545 (lambda* (#:key inputs outputs #:allow-other-keys)
546 (let* ((out (assoc-ref outputs "out"))
547 (man (string-append out "/share/man/man1"))
548 (misc (string-append out "/share/borg/misc")))
549 (for-each (cut install-file <> misc)
550 '("docs/misc/create_chunker-params.txt"
551 "docs/misc/internals-picture.txt"
552 "docs/misc/prune-example.txt"))
553 (add-installed-pythonpath inputs outputs)
554 (invoke "python3" "setup.py" "build_man")
555 (copy-recursively "docs/man" man)
558 `(("python-cython" ,python-cython)
559 ("python-setuptools-scm" ,python-setuptools-scm)
560 ("python-pytest" ,python-pytest)
561 ;; For generating the documentation.
562 ("python-sphinx" ,python-sphinx)
563 ("python-guzzle-sphinx-theme" ,python-guzzle-sphinx-theme)))
569 ("python-llfuse" ,python-llfuse)
570 ;; The Python msgpack library changed its name so Borg requires this
571 ;; transitional package for now:
572 ;; <https://bugs.gnu.org/30662>
573 ("python-msgpack" ,python-msgpack-transitional)
575 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
576 (description "Borg is a deduplicating backup program. Optionally, it
577 supports compression and authenticated encryption. The main goal of Borg is to
578 provide an efficient and secure way to backup data. The data deduplication
579 technique used makes Borg suitable for daily backups since only changes are
580 stored. The authenticated encryption technique makes it suitable for backups
581 to not fully trusted targets. Borg is a fork of Attic.")
582 (home-page "https://www.borgbackup.org/")
583 (license license:bsd-3)))
592 "https://pypi.python.org/packages/source/A/Attic/Attic-"
596 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
597 (build-system python-build-system)
599 `(;; The tests assume they are run as root:
600 ;; https://github.com/jborg/attic/issues/7
603 (modify-phases %standard-phases
605 'build 'set-openssl-prefix
606 (lambda* (#:key inputs #:allow-other-keys)
607 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
612 ("python-msgpack" ,python-msgpack)
614 ;; Attic is probably incompatible with llfuse > 0.41.
615 ;; These links are to discussions of llfuse compatibility from
616 ;; the borg project. Borg is a recent fork of attic, and attic
617 ;; has not been updated since the fork, so it's likely that
618 ;; llfuse compatibility requirements are still the same.
619 ;; https://github.com/borgbackup/borg/issues/642
620 ;; https://github.com/borgbackup/borg/issues/643
621 ("python-llfuse" ,python-llfuse-0.41)))
622 (synopsis "Deduplicating backup program")
623 (description "Attic is a deduplicating backup program. The main goal of
624 Attic is to provide an efficient and secure way to backup data. The data
625 deduplication technique used makes Attic suitable for daily backups since only
626 changes are stored.")
627 (home-page "https://attic-backup.org/")
628 (license license:bsd-3)
629 (properties `((superseded . ,borg)))))
631 (define-public wimlib
637 (uri (string-append "https://wimlib.net/downloads/"
638 name "-" version ".tar.gz"))
641 "0ks6hq7vwq13ljkzxp3a490bf8dnracgl2azf57rg49ad2fzab45"))))
642 (build-system gnu-build-system)
644 `(("pkg-config" ,pkg-config)))
649 ("openssl" ,openssl)))
651 `(#:configure-flags (list "--enable-test-support")))
652 (home-page "https://wimlib.net/")
653 (synopsis "WIM file manipulation library and utilities")
654 (description "wimlib is a C library and set of command-line utilities for
655 creating, modifying, extracting, and mounting archives in the Windows Imaging
656 Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
657 NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
658 ;; wimlib is dual-licenced under version 3 or later of either the GPL or
659 ;; LGPL, except those files explicitly marked as being released into the
660 ;; public domain (CC0) in their headers.
661 (license (list license:gpl3+
673 "http://code.liw.fi/debian/pool/main/o/obnam/obnam_"
674 version ".orig.tar.xz"))
677 "0qlipsq50hca71zc0dp1mg9zs12qm0sbblw7qfzl0hj6mk2rv1by"))))
678 (build-system python-build-system)
682 (modify-phases %standard-phases
685 (substitute* "obnamlib/vfs_local_tests.py"
686 ;; Check for the nobody user instead of root.
687 (("self.fs.get_username\\(0\\), 'root'")
688 "self.fs.get_username(65534), 'nobody'")
689 ;; Disable tests checking for root group.
690 (("self.fs.get_groupname\\(0\\)") "'root'"))
691 (substitute* "obnamlib/vfs_local.py"
692 ;; Don't cover get_groupname function.
693 (("def get_groupname\\(self, gid\\):")
694 "def get_groupname(self, gid): # pragma: no cover"))
695 ;; Can't run network tests.
696 (invoke "./check" "--unit-tests"))))))
698 `(("python2-cliapp" ,python2-cliapp)
699 ("python2-larch" ,python2-larch)
700 ("python2-paramiko" ,python2-paramiko)
701 ("python2-pyaml" ,python2-pyaml)
702 ("python2-tracing" ,python2-tracing)
703 ("python2-ttystatus" ,python2-ttystatus)))
706 ("python2-coverage" ,python2-coverage)
707 ("python2-coverage-test-runner" ,python2-coverage-test-runner)
708 ("python2-pep8" ,python2-pep8)
709 ("python2-pylint" ,python2-pylint)))
710 (home-page "https://obnam.org/")
711 (synopsis "Easy and secure backup program")
712 (description "Obnam is an easy, secure backup program. Features
713 include snapshot backups, data de-duplication and encrypted backups
714 using GnuPG. Backups can be stored on local hard disks, or online via
715 the SSH SFTP protocol. The backup server, if used, does not require
716 any special software, on top of SSH.")
717 (license license:gpl3+)))
719 (define-public dirvish
723 (build-system gnu-build-system)
727 "http://dirvish.org/dirvish-" version ".tgz"))
730 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
732 `(#:modules ((ice-9 match) (ice-9 rdelim)
733 ,@%gnu-build-system-modules)
735 ;; This mostly mirrors the steps taken in the install.sh that ships
736 ;; with dirvish, but simplified because we aren't prompting interactively
737 (modify-phases %standard-phases
742 (lambda* (#:key inputs outputs #:allow-other-keys)
743 ;; These are mostly the same steps the install.sh that comes with
745 (let* (;; Files we'll be copying
747 '("dirvish" "dirvish-runall"
748 "dirvish-expire" "dirvish-locate"))
750 '(("dirvish" "8") ("dirvish-runall" "8")
751 ("dirvish-expire" "8") ("dirvish-locate" "8")
752 ("dirvish.conf" "5")))
755 (assoc-ref outputs "out"))
757 ;; Just a default... not so useful on guixsd though
758 ;; You probably want to a service with file(s) to point to.
759 (confdir "/etc/dirvish")
761 (perl (string-append (assoc-ref %build-inputs "perl")
763 (loadconfig.pl (call-with-input-file "loadconfig.pl"
767 (define (write-pl filename)
769 (string-append "#!" perl "\n\n"
770 "$CONFDIR = \"" confdir "\";\n\n"))
771 (define input-file-location
772 (string-append filename ".pl"))
773 (define target-file-location
774 (string-append output-dir "/bin/" filename ".pl"))
775 (define text-to-write
776 (string-append pl-header
777 (call-with-input-file input-file-location
780 (with-output-to-file target-file-location
782 (display text-to-write)))
783 (chmod target-file-location #o755)
784 (wrap-program target-file-location
785 `("PERL5LIB" ":" prefix
786 ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
787 "/lib/perl5/site_perl"))
788 '("perl-libtime-period"
789 "perl-libtime-parsedate")))))
795 (string-append file-base "." man-num))
797 (string-append output-dir
798 "/share/man/man" man-num
800 (copy-file filename output-path)))))
803 (mkdir-p (string-append output-dir "/bin/"))
804 (mkdir-p (string-append output-dir "/share/man/man8/"))
805 (mkdir-p (string-append output-dir "/share/man/man5/"))
807 ;; Write out executables
808 (for-each write-pl executables)
809 ;; Write out man pages
810 (for-each write-man man-pages)
815 ("perl-libtime-period" ,perl-libtime-period)
816 ("perl-libtime-parsedate" ,perl-libtime-parsedate)))
817 (home-page "http://dirvish.org/")
818 (synopsis "Fast, disk based, rotating network backup system")
820 "With dirvish you can maintain a set of complete images of your
821 file systems with unattended creation and expiration. A dirvish backup vault
822 is like a time machine for your data. ")
823 (license (license:fsf-free "file://COPYING"
824 "Open Software License 2.0"))))
826 (define-public restic
830 ;; TODO Try packaging the bundled / vendored dependencies in the 'vendor/'
835 "https://github.com/restic/restic/releases/download/"
836 "v" version "/restic-" version ".tar.gz"))
837 (file-name (string-append name "-" version ".tar.gz"))
840 "15f0rsm2lxk4lmn4773q28g49p68pqyyx0ccp7r556asan73p79m"))))
841 (build-system go-build-system)
843 `(#:import-path "github.com/restic/restic"
844 #:unpack-path "github.com/restic"
845 ;; We don't need to install the source code for end-user applications.
848 (modify-phases %standard-phases
850 (lambda* (#:key inputs #:allow-other-keys)
851 (with-directory-excursion (string-append
852 "src/github.com/restic/restic-"
854 (invoke "go" "run" "build.go"))))
857 (lambda* (#:key outputs #:allow-other-keys)
858 (let ((out (assoc-ref outputs "out"))
859 (src (string-append "src/github.com/restic/restic-"
861 (install-file (string-append src "/restic")
862 (string-append out "/bin"))
865 (add-after 'install 'install-docs
866 (lambda* (#:key outputs #:allow-other-keys)
867 (let* ((out (assoc-ref outputs "out"))
869 (man-section (string-append man "/man"))
870 (src (string-append "src/github.com/restic/restic-"
871 ,version "/doc/man/")))
872 ;; Install all the man pages to "out".
876 (string-append out man-section
877 (string-take-right file 1))))
878 (find-files src "\\.[1-9]"))
881 (add-after 'install-docs 'install-shell-completion
882 (lambda* (#:key outputs #:allow-other-keys)
883 (let* ((out (assoc-ref outputs "out"))
884 (bin (string-append out "/bin"))
885 (etc (string-append out "/etc"))
886 (share (string-append out "/share")))
889 (let* ((shell-name (symbol->string shell))
890 (dir (string-append "etc/completion/" shell-name)))
892 (invoke (string-append bin "/restic") "generate"
893 (string-append "--" shell-name "-completion")
894 (string-append dir "/"
897 ((zsh) "_restic"))))))
899 (with-directory-excursion "etc/completion"
900 (install-file "bash/restic"
901 (string-append etc "/bash_completion.d"))
902 (install-file "zsh/_restic"
903 (string-append share "/zsh/site-functions")))
905 (home-page "https://restic.net/")
906 (synopsis "Backup program with multiple revisions, encryption and more")
907 (description "Restic is a program that does backups right and was designed
908 with the following principles in mind:
911 @item Easy: Doing backups should be a frictionless process, otherwise you
912 might be tempted to skip it. Restic should be easy to configure and use, so
913 that, in the event of a data loss, you can just restore it. Likewise,
914 restoring data should not be complicated.
916 @item Fast: Backing up your data with restic should only be limited by your
917 network or hard disk bandwidth so that you can backup your files every day.
918 Nobody does backups if it takes too much time. Restoring backups should only
919 transfer data that is needed for the files that are to be restored, so that
920 this process is also fast.
922 @item Verifiable: Much more important than backup is restore, so restic
923 enables you to easily verify that all data can be restored. @item Secure:
924 Restic uses cryptography to guarantee confidentiality and integrity of your
925 data. The location the backup data is stored is assumed not to be a trusted
926 environment (e.g. a shared space where others like system administrators are
927 able to access your backups). Restic is built to secure your data against
930 @item Efficient: With the growth of data, additional snapshots should only
931 take the storage of the actual increment. Even more, duplicate data should be
932 de-duplicated before it is actually written to the storage back end to save
933 precious backup space.
935 (license license:bsd-2)))