#!/usr/bin/sh
#
# Copyright (c) 2025 Rackslab
# SPDX-License-Identifier: MIT
#
# Wrapper script for the slurm-quota charge command, designed to be executed
# by Slurm as a JobCompType=jobcomp/script. The wrapper is required because
# Slurm cannot directly execute the slurm-quota command with arguments as a
# JobCompType=jobcomp/script.

# Redirect output to the log file because Slurm redirects script output to
# /dev/null. This way, the log file will contain the output of the slurm-quota
# charge command, including errors.
exec &>>/var/log/slurm/charge/slurm-quota-charge.log

# Execute the slurm-quota charge command
exec /usr/bin/slurm-quota charge "$@"
