Simple ebuild for zfs-auto-snapshot (https://github.com/dajhorn/zfs-auto-snapshot). Those are only shell scripts emulating the auto snapshot service of Solaris. Reproducible: Always Steps to Reproduce: 1. emerge zfs-auto-snapshot Actual Results: No package found Expected Results: Existing package
Created attachment 326038 [details] zfs-auto-snapshot-9999.ebuild
Created attachment 327462 [details] zfs-auto-snapshot-9999.ebuild Improved version of zfs-auto-snapshot live ebuild
(In reply to comment #2) > Created attachment 327462 [details] > zfs-auto-snapshot-9999.ebuild > > Improved version of zfs-auto-snapshot live ebuild Hi Sergey, I'm not sure you want to remove execute flag from the cron scripts other than the crond.d one: the other ones need to be executable to be executed. Rgds, V
(In reply to comment #3) > (In reply to comment #2) > > Created attachment 327462 [details] > > zfs-auto-snapshot-9999.ebuild > > > > Improved version of zfs-auto-snapshot live ebuild > > Hi Sergey, > I'm not sure you want to remove execute flag from the cron scripts other > than the crond.d one: the other ones need to be executable to be executed. > Rgds, > V You are partially right, but i think that it would be better to add apropriate info to pkg_postinst to tell users of this package how to enable it(by doing chmod +x on those files in cron directories).
(In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > Created attachment 327462 [details] > > > zfs-auto-snapshot-9999.ebuild > > > > > > Improved version of zfs-auto-snapshot live ebuild > > > > Hi Sergey, > > I'm not sure you want to remove execute flag from the cron scripts other > > than the crond.d one: the other ones need to be executable to be executed. > > Rgds, > > V > > You are partially right, but i think that it would be better to add > apropriate info to pkg_postinst to tell users of this package how to enable > it(by doing chmod +x on those files in cron directories). I don't understand what would be the added value to have the user finish the install manually when we can automate it.
(In reply to comment #5) > I don't understand what would be the added value to have the user finish the > install manually when we can automate it. For example: i do not want hourly,weekly and monthly backups, only daily ones. Maybe it would be better disable those cron scripts and let user explanation how to enable only those, which is needed for him?
The URLs for both the repo and home page have changed EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git" HOMEPAGE="https://github.com/zfsonlinux/zfs-auto-snapshot/"
it's not good to remove exec flag to remove execute flag from the cron scripts other than the crond.d one. the better solution is turn on "--default-exclude" option by default 1. all cron script add paramter "--default-exclude" 2. modify zfs-auto-snapshot.sh: opt_default_exclude='' -> opt_default_exclude='1' then let user use attribute com.sun:sanashot to decide which filesyste to make snapshot. ex. # zfs set com.sun:auto-snapshot=false rpool # zfs set com.sun:auto-snapshot=true rpool # zfs set com.sun:auto-snapshot:weekly=true rpool
I modify the ebuild as below: # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=4 EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git" inherit git-2 DESCRIPTION="Automatic snapshots for ZFS on Linux" HOMEPAGE="https://github.com/dajhorn/zfs-auto-snapshot/" LICENSE="GPL-2" KEYWORDS="amd64" SLOT="0" IUSE="+default-exclude" DEPEND="" RDEPEND="sys-fs/zfs virtual/cron" DOCS=( README ) src_install() { default use default-exclude && for cronfile in /etc/cron.{d,daily,hourly,monthly,weekly}/${PN} ; do einfo "adjust $cronfile ..." sed -i "s/\(${PN}\)/\1 --default-exclude/" ${D}/$cronfile || die done # Remove execute flag for crontab files fperms a-x /etc/cron.d/${PN} } pkg_postinst() { use default-exclude || ewarn "without use default-exclude. all zfs filesystem will under all kind of snapshot." elog "use attribute com.sun:auto-snapshot to decide which filesystem to" elog "make snapshot. the rule is:" elog "zfs set com.sun:auto-snapshot=[true|false]" elog "or" elog "zfs set com.sun:auto-snapshot:<frequent|hourly|daily|weekly|monthly>=[true|false]" elog elog "ex." elog "# zfs set com.sun:auto-snapshot=false rpool" elog "# zfs set com.sun:auto-snapshot=true rpool" elog "# zfs set com.sun:auto-snapshot:weekly=true rpool" elog elog "for detail pls visit http://docs.oracle.com/cd/E19082-01/817-2271/ghzuk/" }
by the way. fcron seems dosen't suport /etc/cron.d usr should add cron job to fcron for make frequent snapshot work.
Created attachment 348570 [details] ebuild support default-exclude by default
*** Bug 469840 has been marked as a duplicate of this bug. ***
This ebuild installs the man page to /share/man/man8/zfs-auto-snapshot.8 instead of /usr//share/man/man8/zfs-auto-snapshot.8, and it does not compress it.
fresh EAPI6 ebuild available here currently. https://github.com/gyakovlev/gentoo-overlay/tree/master/sys-fs/zfs-auto-snapshot I'm going to submit it to the main repo soon and maintain. feel free to use above one meanwhile. it does not remove executable bit, but it does enable exclude by default. fcron is also taken care of in pkg_postinst as s mere warning.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d769a2585b1de6503acc1c1ecabb69623b7bd78 commit 5d769a2585b1de6503acc1c1ecabb69623b7bd78 Author: Georgy Yakovlev <ya@sysdump.net> AuthorDate: 2018-04-01 06:33:13 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2018-05-11 17:35:50 +0000 sys-fs/zfs-auto-snapshot: new package Closes: https://bugs.gentoo.org/437636 Closes: https://github.com/gentoo/gentoo/pull/7763 Package-Manager: Portage-2.3.27, Repoman-2.3.9 sys-fs/zfs-auto-snapshot/Manifest | 1 + sys-fs/zfs-auto-snapshot/files/README.gentoo | 22 +++++++++ sys-fs/zfs-auto-snapshot/metadata.xml | 28 ++++++++++++ .../zfs-auto-snapshot-1.2.4.ebuild | 52 ++++++++++++++++++++++ .../zfs-auto-snapshot-9999.ebuild | 52 ++++++++++++++++++++++ 5 files changed, 155 insertions(+)