]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- run cleanup service every hour 897/head
authorArvin Schnell <aschnell@suse.de>
Wed, 17 Apr 2024 13:07:59 +0000 (15:07 +0200)
committerArvin Schnell <aschnell@suse.de>
Wed, 17 Apr 2024 13:22:52 +0000 (15:22 +0200)
Makefile.am
data/cleanup.timer
dists/debian/rules
dists/debian/snapper.install
dists/debian/snapper.preinst
doc/snapper.xml.in
package/snapper.changes
scripts/Makefile.am
scripts/snapper-daily [deleted file]
scripts/snapper-hourly
snapper.spec.in

index a04e4531dc76288d90e0d4d0086e8cdb873ae8d0..69b66787a46fce3b0b05af6e04bd4757c9ca80fe 100644 (file)
@@ -31,11 +31,13 @@ UBUNTU_FLAVOURS =   \
        xUbuntu_22.04   \
        xUbuntu_22.10   \
        xUbuntu_23.04   \
-       xUbuntu_23.10
+       xUbuntu_23.10   \
+       xUbuntu_24.04
 
 RASPBIAN_FLAVOURS =    \
        Raspbian_10     \
-       Raspbian_11
+       Raspbian_11     \
+       Raspbian_12
 
 show-debian:
        @echo "Debian flavors: $(DEBIAN_FLAVOURS)"
index 40e7dd702d870b18379c1c4d18376e52efb6c278..9c639a333defe763a8c33cd466e8627a75e49d65 100644 (file)
@@ -5,7 +5,7 @@ Documentation=man:snapper(8) man:snapper-configs(5)
 
 [Timer]
 OnBootSec=10m
-OnUnitActiveSec=1d
+OnUnitActiveSec=1h
 
 [Install]
 WantedBy=timers.target
index a58f42eac952111eb01f592c6e636fa9add51e50..a3681060036f33ea3d30a0e9dda2826bc9a65e75 100644 (file)
@@ -23,4 +23,3 @@ override_dh_auto_install:
        dh_auto_install
        install -D -m 644 data/sysconfig.snapper $$(pwd)/debian/tmp/etc/sysconfig/snapper
        mv $$(pwd)/debian/tmp/etc/cron.hourly/suse.de-snapper $$(pwd)/debian/tmp/etc/cron.hourly/snapper
-       mv $$(pwd)/debian/tmp/etc/cron.daily/suse.de-snapper $$(pwd)/debian/tmp/etc/cron.daily/snapper
index 77bb37e8ca35ca1fc9d8d5537457dc5beb2195a2..a1d733db5827985672a1f17c403d6c71bc095d84 100644 (file)
@@ -1,4 +1,3 @@
-etc/cron.daily/snapper
 etc/cron.hourly/snapper
 etc/logrotate.d/snapper
 usr/bin/snapper
index 758f4c33aea57677b7ef3b3a7db9ef1f1c8a21b3..75f6768e14a471743709961cf971957e720528f4 100644 (file)
@@ -18,12 +18,6 @@ version=$2
 # will not need this.
 
 if [ "$action" = upgrade ]; then
-  # move /etc/cron.daily/snapper/suse.de-snapper to the correct location
-  if [ -e /etc/cron.daily/snapper/suse.de-snapper ]; then
-    mv /etc/cron.daily/snapper/suse.de-snapper /etc/cron.daily/snapper.cron
-    rm -rf /etc/cron.daily/snapper
-    mv /etc/cron.daily/snapper.cron /etc/cron.daily/snapper
-  fi
   # move /etc/cron.hourly/snapper/suse.de-snapper to the correct location
   if [ -e /etc/cron.hourly/snapper/suse.de-snapper ]; then
     mv /etc/cron.hourly/snapper/suse.de-snapper /etc/cron.hourly/snapper.cron
index b8495404bc69b31b3c6bd54d8654c69fd81aad2d..282c42921bc4acac9f1b04a6e46cba725102e8ca 100644 (file)
       <title>Cleanup Algorithms</title>
 
       <para>Snapper provides several algorithms to clean up old snapshots. The
-      algorithms are executed in a daily cronjob or systemd timer. This can be configured in the
+      algorithms are executed in an hourly cronjob or systemd timer. This can be configured in the
       corresponding configurations files along with parameters for every
       algorithm.</para>
 
index b967ee17cdf109a3e758531caed92d1f3f5118b4..7ab3faf9a87129de075e2b7cb0ce4787154f4850 100644 (file)
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Wed Apr 17 15:00:13 CEST 2024 - aschnell@suse.com
+
+- run cleanup service every hour (gh#openSUSE/snapper#885)
+
 -------------------------------------------------------------------
 Tue Apr 16 17:59:58 CEST 2024 - aschnell@suse.com
 
index 0839c706c12b60ff2273d96bd5e119b51d8bf7cc..1f8176c2cba211853ffee4330a1c369e6f6ea06a 100644 (file)
@@ -14,10 +14,9 @@ pam_snapper_SCRIPTS =                        \
 
 endif
 
-EXTRA_DIST = snapper-hourly snapper-daily bash-completion.bash zsh-completion.zsh $(pam_snapper_SCRIPTS)
+EXTRA_DIST = snapper-hourly bash-completion.bash zsh-completion.zsh $(pam_snapper_SCRIPTS)
 
 install-data-local:
        install -D snapper-hourly $(DESTDIR)/etc/cron.hourly/suse.de-snapper
-       install -D snapper-daily $(DESTDIR)/etc/cron.daily/suse.de-snapper
        install -D --mode a+r,u+w bash-completion.bash $(DESTDIR)/usr/share/bash-completion/completions/snapper
        install -D --mode a+r,u+w zsh-completion.zsh $(DESTDIR)/usr/share/zsh/site-functions/_snapper
diff --git a/scripts/snapper-daily b/scripts/snapper-daily
deleted file mode 100755 (executable)
index 27e7a10..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-
-#
-# paranoia settings
-#
-umask 022
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-export PATH
-
-
-#
-# get information from /etc/sysconfig/snapper
-#
-if [ -f /etc/sysconfig/snapper ] ; then
-    . /etc/sysconfig/snapper
-fi
-
-
-#
-# run snapper for all configs
-#
-for CONFIG in $SNAPPER_CONFIGS ; do
-
-    NUMBER_CLEANUP="no"
-    TIMELINE_CLEANUP="no"
-    EMPTY_PRE_POST_CLEANUP="no"
-
-    . /etc/snapper/configs/$CONFIG
-
-    if [ "$NUMBER_CLEANUP" = "yes" ] ; then
-       snapper --config=$CONFIG --quiet cleanup number
-    fi
-
-    if [ "$TIMELINE_CLEANUP" = "yes" ] ; then
-       snapper --config=$CONFIG --quiet cleanup timeline
-    fi
-
-    if [ "$EMPTY_PRE_POST_CLEANUP" = "yes" ] ; then
-       snapper --config=$CONFIG --quiet cleanup empty-pre-post
-    fi
-
-done
-
-exit 0
index bc6cd4dd173e685ef7aef3d4b7338bc06e78e896..36a41f57302619ceff343378c4c985e990d6988e 100755 (executable)
@@ -17,7 +17,7 @@ fi
 
 
 #
-# run snapper for all configs
+# run snapper timeline for all configs
 #
 for CONFIG in $SNAPPER_CONFIGS ; do
 
@@ -31,4 +31,29 @@ for CONFIG in $SNAPPER_CONFIGS ; do
 
 done
 
+#
+# run snapper cleanup for all configs
+#
+for CONFIG in $SNAPPER_CONFIGS ; do
+
+    NUMBER_CLEANUP="no"
+    TIMELINE_CLEANUP="no"
+    EMPTY_PRE_POST_CLEANUP="no"
+
+    . /etc/snapper/configs/$CONFIG
+
+    if [ "$NUMBER_CLEANUP" = "yes" ] ; then
+       snapper --config=$CONFIG --quiet cleanup number
+    fi
+
+    if [ "$TIMELINE_CLEANUP" = "yes" ] ; then
+       snapper --config=$CONFIG --quiet cleanup timeline
+    fi
+
+    if [ "$EMPTY_PRE_POST_CLEANUP" = "yes" ] ; then
+       snapper --config=$CONFIG --quiet cleanup empty-pre-post
+    fi
+
+done
+
 exit 0
index 7a787edeb133d73265d1bc9c41d341f316e05811..ca1f502fbd633556f61ec72b1e9d9cd974518286 100644 (file)
@@ -150,7 +150,6 @@ make %{?_smp_mflags}
 %make_install
 rm -f "%{buildroot}/%{_libdir}"/*.la "%{buildroot}/%{pam_security_dir}/pam_snapper.la"
 rm -f %{buildroot}/etc/cron.hourly/suse.de-snapper
-rm -f %{buildroot}/etc/cron.daily/suse.de-snapper
 
 %if 0%{?suse_version}
 install -D -m 644 data/sysconfig.snapper "%{buildroot}%{_fillupdir}/sysconfig.snapper"
@@ -186,10 +185,6 @@ if [ -f /etc/cron.hourly/suse.de-snapper ]; then
  systemctl preset snapper-timeline.timer || :
  systemctl is-enabled -q snapper-timeline.timer && systemctl start snapper-timeline.timer || :
 fi
-if [ -f /etc/cron.daily/suse.de-snapper ]; then
- systemctl preset snapper-cleanup.timer || :
- systemctl is-enabled -q snapper-cleanup.timer && systemctl start snapper-cleanup.timer || :
-fi
 %service_add_post snapper-boot.service snapper-boot.timer snapper-cleanup.service snapper-cleanup.timer snapper-timeline.service snapper-timeline.timer snapperd.service
 %endif