blob: 2751b6b9f72e5e235f9241065ef6559890827020 [file] [log] [blame]
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "Remove all bootstat data except the most recent"
author "chromium-os-dev@chromium.org"
start on started system-services
script
# Every time we shut down, we save a log of all the bootstat event
# files. To prevent unbounded growth, when we get back here, we
# remove the data for all but the 50 most recent boots.
BOOT_LOG_ROTATE_COUNT=50
rm -rf $(ls -dt /var/log/metrics/shutdown.[0-9]* |
sed "1,$BOOT_LOG_ROTATE_COUNT d")
end script