From ce2f17a42b8e113e677b307decde86f29aef10c1 Mon Sep 17 00:00:00 2001 From: Cyteen Date: Sat, 25 Nov 2017 15:47:52 +0000 Subject: [PATCH] Add fix to the cron scripts to prevent maxing out i/o. --- 020_zfs-auto-snapshot.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/020_zfs-auto-snapshot.sh b/020_zfs-auto-snapshot.sh index 5c1c6f8..839364d 100644 --- a/020_zfs-auto-snapshot.sh +++ b/020_zfs-auto-snapshot.sh @@ -8,14 +8,22 @@ ## A .deb package can be created for zfs-auto-snapshot: apt-get -y install git build-essential zfsnap apt-get -y install zfs-auto-snapshot -ZSH_BUILD_HOME=/var/tmp/zfs-auto-snapshot -mkdir -p ${ZSH_BUILD_HOME} && \ - cd ${ZSH_BUILD_HOME} && \ - git clone https://github.com/zfsonlinux/zfs-auto-snapshot.git && \ - cd ${ZSH_BUILD_HOME}/zfs-auto-snapshot &&\ - git merge origin/debian && \ - dpkg-buildpackage -b -uc -us && \ - dpkg -i ../zfs-auto-snapshot_*.deb +#ZSH_BUILD_HOME=/var/tmp/zfs-auto-snapshot +#mkdir -p ${ZSH_BUILD_HOME} && \ +# cd ${ZSH_BUILD_HOME} && \ +# git clone https://github.com/zfsonlinux/zfs-auto-snapshot.git && \ +# cd ${ZSH_BUILD_HOME}/zfs-auto-snapshot &&\ +# git merge origin/debian && \ +# dpkg-buildpackage -b -uc -us && \ +# dpkg -i ../zfs-auto-snapshot_*.deb + +# Without --fast the zfs list command regularly takes too long, 100% i/o. +sed -i 's|-q|--quiet|g' /etc/cron.d/zfs-auto-snapshot +sed -i 's|-g|--syslog|g' /etc/cron.d/zfs-auto-snapshot + +for i in $(find /etc/cron.*/zfs-auto-snapshot); do + sed -i 's|--quiet|--quiet --fast|g' "${i}" +done ## 2. home directory set for zfssnap role (the user taking snapshots and ## doing the sending):