Merge "Remove XFS filesystem from the daily mlocate cron job"
This commit is contained in:
commit
bf85beb999
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- The XFS filesystem is excluded from the daily mlocate crond job
|
||||||
|
in order to conserve disk IO for large IOPS bursts due to
|
||||||
|
updatedb/mlocate file indexing.
|
@ -109,3 +109,13 @@
|
|||||||
tags:
|
tags:
|
||||||
- swift-dirs
|
- swift-dirs
|
||||||
- swift-logs
|
- swift-logs
|
||||||
|
|
||||||
|
- name: Configure mlocate for cron.daily
|
||||||
|
template:
|
||||||
|
src: "mlocate-crond-daily.sh.j2"
|
||||||
|
dest: "/etc/cron.daily/mlocate"
|
||||||
|
mode: "0755"
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
tags:
|
||||||
|
- swift-crond
|
||||||
|
21
templates/mlocate-crond-daily.sh.j2
Normal file
21
templates/mlocate-crond-daily.sh.j2
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
[ -x /usr/bin/updatedb.mlocate ] || exit 0
|
||||||
|
|
||||||
|
if which on_ac_power >/dev/null 2>&1; then
|
||||||
|
ON_BATTERY=0
|
||||||
|
on_ac_power >/dev/null 2>&1 || ON_BATTERY=$?
|
||||||
|
if [ "$ON_BATTERY" -eq 1 ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# See ionice(1)
|
||||||
|
if [ -x /usr/bin/ionice ] && /usr/bin/ionice -c3 true 2>/dev/null; then
|
||||||
|
IONICE="/usr/bin/ionice -c3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
flock --nonblock /run/mlocate.daily.lock $IONICE /usr/bin/updatedb.mlocate --prunefs xfs
|
Loading…
x
Reference in New Issue
Block a user