Personal tools

Creating logs from the command line

From Rivendell Wiki

Jump to: navigation, search

Creating logs from the command line


Stefan wrote on about January 24th

> >> For a highly automated station here in Germany I have also add command
> >> line switches to rdlogmanager to make log generation batchable.
> >> -g  generate log
> >> -m  merge music
> >> -t  merge traffic
> >> -s Service
> >> -d day  The day the log should created for counted from today. Default
> >> is 1 (create a log for tomorrow).
> >>
> >> The -s switch is allways needed, also at least one of -g -m or -t
> >>
> >> To generate a log for tomorrow for service "OnAir" the command would be:
> >> rdlogmanager -g -s OnAir
> >>
> >> To generate and merge a log for Sunday on Friday:
> >> rdlogmanager -g -m -t -s OnAir -d 2
> >>
> >> Stefan

To let rdlogmanager run without trying to connect to a display (useful for cronjobs):
DISPLAY=:0 rdlogmanager ...

Example
My crontab entry is:
30 01 * * * /home/.../sustainLogGen.sh
My sustainLogGen.sh is:
#!/bin/bash
export DISPLAY=:0.0
/usr/bin/rdlogmanager -g -s Production -d 3
exit 0

Be sure to run (as rduser and logged into X)...
xhost +localhost
... which will let any process on the local machine connect to your display.

Log Creation With Rdcatch

If you would rather the rdcatch daemon make logs create a macro cart with a line like this:

 RN DISPLAY=:0.0 rdlogmanager -g -s SERVICE -d 1! 

This executes rdlogmanager on the default display under the permission of rdcatchd deamon. That is to say if the user that runs rdcatchd and the user that runs your xorg server are different, don't expect this work. Now just schedule that cart to run every day in rdcatch.