Subject: Re: bug#26030: [PATCH] gnu: Add rsnapshot.

From: Thomas Danckaert <[email-masked]>
Date: Thu, 09 Mar 2017 09:23:25 +0100 (CET)

From: Leo Famulari <[email-masked]>
Subject: Re: bug#26030: [PATCH] gnu: Add rsnapshot.
Date: Wed, 8 Mar 2017 15:23:46 -0500

> On Wed, Mar 08, 2017 at 08:08:56PM +0100, Thomas Danckaert wrote:
>> Subject: [PATCH] gnu: Add rsnapshot.
>>
>> * gnu/packages/backup.scm (rsnapshot): New variable.
>
> Cool, the venerable rsnapshot!

glad you agree :-)

> We should use the tarball from
> <https://github.com/rsnapshot/rsnapshot/releases/download/1.4.2/rsnapshot-1.4.2.tar.gz>
> instead, which is already bootstrapped. Then, we can leave out these
> native-inputs.
>
> The tarballs like 1.4.2.tar.gz are just directory snapshots
> automatically generated by GitHub when you create a new tag. Often 
> the
> project will provide a "real" release tarball, as in this case.

Ah yes, I got a little confused by the different links offered in the 
github “Downloads” section.  They should just remove those “source 
code”  links (made me think that the other link contained 
pre-compiled stuff).

> The built package doesn't retain a reference to openssh. But, I
> recommend not including openssh, even though there is a 'cmd_ssh' 
> field
> in the rsnapshot configuration file. Rsnapshot can work locally 
> without
> SSH, and users may want to use something besides OpenSSH.

Yes, you're right. I thought it would need it for the tests, but it 
happily skips the ssh tests, it seems.

>> +    (synopsis "Incremental backup utility based on rsync")
>
> I'd call it a "Deduplicating snapshot backup utility based on 
> rsync",
> but I admit this is a nit-pick, and you can ignore it :)

I Picked the nit anyway.

> I'd say, "To reduce the disk space required for each backup, 
> rsnapshot
> uses hard links to deduplicate identical files". This way, the 
> reader
> knows how the code uses hard links.

done.

> Can you send an updated patch?

Attached, feel free to add “Co-authored by...“ :-)

Thomas
From b59515ba09cd7dc8767d23eb4e00cb94463e2dd0 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <[email-masked]>
Date: Wed, 8 Mar 2017 18:04:58 +0100
Subject: [PATCH] gnu: Add rsnapshot.

* gnu/packages/backup.scm (rsnapshot): New variable.
---
 gnu/packages/backup.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 986ffef08..e320904b4 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2014 Ian Denhardt <[email-masked]>
 ;;; Copyright © 2015, 2016 Leo Famulari <[email-masked]>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <[email-masked]>
+;;; Copyright © 2017 Thomas Danckaert <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -43,6 +44,7 @@
   #:use-module (gnu packages mcrypt)
   #:use-module (gnu packages nettle)
   #:use-module (gnu packages pcre)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages rsync)
@@ -373,6 +375,43 @@ to a remote location, and only the differences will be transmitted.  Finally,
 rdiff-backup is easy to use and settings have sensible defaults.")
     (license license:gpl2+)))
 
+(define-public rsnapshot
+  (package
+    (name "rsnapshot")
+    (version "1.4.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/rsnapshot/rsnapshot/releases/download/"
+             version "/rsnapshot-" version ".tar.gz"))
+       (sha256
+        (base32
+         "05jfy99a0xs6lvsjfp3wz21z0myqhmwl2grn3jr9clijbg282ah4"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("perl" ,perl)
+       ("rsync" ,rsync)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (substitute*
+                 '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
+                   "t/backup_exec/conf/backup_exec_fail.conf"
+                   "t/backup_exec/conf/backup_exec.conf")
+               (("/bin/true") (which "true"))
+               (("/bin/false") (which "false")))
+             (zero? (system* "make" "test")))))))
+    (synopsis "Deduplicating snapshot backup utility based on rsync")
+    (description "rsnapshot is a filesystem snapshot utility based on rsync.
+rsnapshot makes it easy to make periodic snapshots of local machines, and
+remote machines over ssh.  To reduce the disk space required for each backup,
+rsnapshot uses hard links to deduplicate identical files.")
+    (home-page "http://rsnapshot.org")
+    (license license:gpl2+)))
+
 (define-public libchop
   (package
     (name "libchop")
-- 
2.11.1