Add -o Apt::Cmd::Disable-Script-Warning=true argument to the apt call, to avoid the "WARNING: apt does not have a stable CLI interface. Use with caution in scripts." messages that otherwise would be printed in the cron logs.
non interactive
shfmt