#!/bin/bash

# Load configuration file
if [ ! -f kp.cfg ]; then
    . /etc/kp.cfg
else
    . kp.cfg
fi

# To prepare the KP data, we need to generage the payload from the
# logs files, the payload from the new files and the size of all files
# (both from the MirrorBrain database).

# Generate the payload form remote logs using the last 40 days
payload 40

# Get the sizes of all files, and consider new files all that are 7 or
# less days old
disk_size 7

# Mergue the payloads
merge_payload $PAYLOAD/payload.txt $DATA/payload_new_no_version.txt > $DATA/payload_final.txt
