unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: raid5atemyhomework via Guix-patches via <guix-patches@gnu.org>
To: 47134@debbugs.gnu.org
Subject: [bug#47134] [PATCH] gnu: Add zfs-auto-snapshot.
Date: Sun, 14 Mar 2021 08:55:18 +0000	[thread overview]
Message-ID: <8khDgDFm8YAH3rsudpda_ASV2o4CdQLmejmEXU3QkRkUFrMfewbzBrqrC4OO2mvpuQUckFSwYmSGadSjNy87Z7NKas5fupZILvGtvPJSa3Y=@protonmail.com> (raw)

From be0c4d4ef73e68ace117f2a1b1396331a4fcdf84 Mon Sep 17 00:00:00 2001
From: raid5atemyhomework <raid5atemyhomework@protonmail.com>
Date: Sun, 14 Mar 2021 16:40:47 +0800
Subject: [PATCH] gnu: Add zfs-auto-snapshot.

* gnu/packages/file-systems.scm (zfs-auto-snapshot): New variable.
---
 gnu/packages/file-systems.scm | 54 +++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index e7d78e41fb..0543be2d82 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -975,6 +975,60 @@ originally developed for Solaris and is now maintained by the OpenZFS
 community.")
     (license license:cddl1.0)))

+(define-public zfs-auto-snapshot
+  (package
+    (name "zfs-auto-snapshot")
+    (version "1.2.4")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+               "https://github.com/zfsonlinux/zfs-auto-snapshot/archive/upstream/"
+               version ".tar.gz"))
+        (sha256
+          (base32 "16ry1w43i44xc67gr73x6fa48ninfhqxr498ad4m3kya93vp2zrh"))))
+    (build-system gnu-build-system)
+    (arguments
+      `(#:tests? #f ; No tests
+        #:phases
+        (modify-phases %standard-phases
+          (delete 'configure)
+          (delete 'build)
+          ;; Guix System may not have a traditional cron system, but
+          ;; the cron scripts installed by this package are convenient
+          ;; to use as targets for an mcron job specification, so make
+          ;; sure they can be run in-store.
+          (add-before 'install 'fix-cron-scripts
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out                (assoc-ref outputs "out"))
+                     (zfs-auto-snapshot  (string-append
+                                           out
+                                           "/sbin/zfs-auto-snapshot")))
+                (substitute* '("etc/zfs-auto-snapshot.cron.daily"
+                               "etc/zfs-auto-snapshot.cron.frequent"
+                               "etc/zfs-auto-snapshot.cron.hourly"
+                               "etc/zfs-auto-snapshot.cron.monthly"
+                               "etc/zfs-auto-snapshot.cron.weekly")
+                  (("zfs-auto-snapshot")
+                   zfs-auto-snapshot)))))
+          ;; Provide DESTDIR and PREFIX on make command.
+          (replace 'install
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let ((out (assoc-ref outputs "out")))
+                (invoke "make" "install"
+                        "PREFIX="
+                        (string-append "DESTDIR=" out)))
+              #t)))))
+    (home-page "https://github.com/zfsonlinux/zfs-auto-snapshot")
+    (synopsis "Automatically create, rotate, and destroy periodic ZFS snapshots")
+    (description
+      "An alternative implementation of the zfs-auto-snapshot service for Linux
+that is compatible with zfs-linux and zfs-fuse.
+
+On Guix System, you will need to invoke the installed shell scripts as @code{job}
+declarations in your @code{operating-system} configuration.")
+    (license license:gpl2+)))
+
 (define-public mergerfs
   (package
     (name "mergerfs")
--
2.30.2





             reply	other threads:[~2021-03-14  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-14  8:55 raid5atemyhomework via Guix-patches via [this message]
2021-03-14 11:07 ` [bug#47134] [PATCH] gnu: Add zfs-auto-snapshot raid5atemyhomework via Guix-patches via
2021-03-14 12:04 ` [bug#47134] [PATCH v2] " raid5atemyhomework via Guix-patches via
2021-10-02 11:39   ` bug#47134: [PATCH] " Arun Isaac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='8khDgDFm8YAH3rsudpda_ASV2o4CdQLmejmEXU3QkRkUFrMfewbzBrqrC4OO2mvpuQUckFSwYmSGadSjNy87Z7NKas5fupZILvGtvPJSa3Y=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=47134@debbugs.gnu.org \
    --cc=raid5atemyhomework@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).