I have a very small script that runs the following command and emails the resulting output to me.
flmprg -a info users > /home/tmp/users.log
When run manually from command line, this produces a simple text file of all currently logged in users utilizing a license.
When same command is run from a cron job, output is always blank, regardless of user executing cron. All users have write permission on output file.
Suggestions?
Hi,
maybe your environment is missing. Have you tried to use bash -l
(see https://stackoverflow.com/a/51591762 (https://stackoverflow.com/a/51591762)) to run your command?
This tutorial https://www.baeldung.com/linux/load-env-variables-in-cron-job (https://www.baeldung.com/linux/load-env-variables-in-cron-job) may also be interesting about to properly set the environment in cron jobs.
Kind regards
Roland