Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: flmprg runnig as cron job creates empty output  (Read 2098 times)
IT D.
Posts: 1


« on: August 27, 2024, 10:45:42 pm »

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?
Roland W.
Posts: 22


« Reply #1 on: August 28, 2024, 01:20:29 pm »

Hi,

maybe your environment is missing. Have you tried to use
Code:
bash -l
(see https://stackoverflow.com/a/51591762) to run your command?
This tutorial 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
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines