This commit is contained in:
Micke Nordin 2025-05-05 08:33:01 +02:00
parent 1a41a66355
commit 1a4ca0ed07
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257
2 changed files with 4 additions and 4 deletions

View file

@ -4,7 +4,7 @@ class sunetdrive::script (
$location = undef
) {
include sunet::packages::python3_pip
include sunet::packages::kopia
include sunet::packages::yq
$environment = sunetdrive::get_environment()
$customer = sunetdrive::get_customer()
$apikey_test = safe_hiera('monitor_apikey_test')

View file

@ -9,16 +9,16 @@ aggregatefile="billing-$(date +%Y%m%d).csv"
tempdir=$(mktemp -d)
# Install yq if needed
yq="/usr/local/bin/yq"
yq="/usr/bin/yq"
if ! [[ -x ${yq} ]]; then
pip3 install yq
apt install yq
fi
olddir=${PWD}
cd "${tempdir}" || (echo "could not move to tempdir" && exit 1)
# Make sure we have dir
rclone mkdir -p "${aggregatedir}"
rclone mkdir "${aggregatedir}"
# Output headers
csv="DATE:$(date +%F) TIME:$(date +%H:%M)
Customer;Total GB;Users;Product"