init: Prevent log directory to be too big

Although we remove old files, if files are big, log directory can be
large. 1GB worth of data have been present in /var/log/chrome.
We start removing files that are at least 7 days old.
We decrease that delay until the directory is 100MB or smaller, but we
always keep at least 1 day worh of log.

Fix variable name error fixed with cl/440413

BUG=chromium:664659
TEST=Fill /var/log/power_manager/ with 200MB worth of file.
for i in $(seq 1 200) ; do
 dd if=/dev/zero of=/var/log/power_manager/power$i bs=1M count=1
done
Check with 'dash -x /tmp/chromeos-cleanup-logs' that loop to delete file
is executed but the files are still present (being accessed less than one
day ago).

Reviewed-on: https://chromium-review.googlesource.com/432978
Reviewed-by: Mike Frysinger <vapier@chromium.org>
(cherry picked from commit 554e973a1ae0561f57b79173fc75eba5f187d889)
(cherry picked from commit 3f9fae50e996873fd281c3966743ce891e73f75f)
Change-Id: I8a050fa51ec5c07ef60f839618bbb633e1a51876
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/450817
1 file changed