2

Is there a way of time stamping Autosys job error file, if it is just STDERR redirection?

std_err_file: >>JOB_NAME.ERR
Andrewww
  • 271
  • 3
  • 6
  • [Be wary of name collisions due to concurrency though.](https://softwareengineering.stackexchange.com/a/61685/201537) – Leponzo Sep 27 '21 at 03:21

2 Answers2

1

try using the date command.

bash-3.2$ date +%d-%m-%y.%H:%M

13-11-19.19:24

so using the above under ``

Add below attribute to your Job definition/ JIL

std_err_file: /dir_path/$AUTO_JOB_NAME-`date +%d-%m-%y.%H:%M`.ERR

The file directed would be

/dir_path/AUTOSYS_JOB_A-13-11-19.19:24.ERR

Good Luck!!

Piyush
  • 818
  • 8
  • 17
  • Have adapted this to Windows: std_err_file: ">>JOB_NAME_%date:/=%.ERR" It does not work this way unfortunately. – Andrewww Nov 15 '19 at 10:02
1

You can kindly try the below options. These work in command prompt of windows should work in autosys too.

Option1: Adding the date variables year month day in the file name while creating jill.

echo "Std out!" >> output_%date:~10,4%%date:~4,2%%date:~7,2%.log
echo "Std err!" >> error_%date:~10,4%%date:~4,2%%date:~7,2%.log

Option2: Adding a variable date_var in the autosys profile.

set date_var=%date:~10,4%%date:~4,2%%date:~7,2%

echo "Std out!" >> output_%date_var%.log
echo "Std err!" >> error_%date_var%.log

Option3: Similar to option2 but declaring the complete log names in profile itself.

set date_var=%date:~10,4%%date:~4,2%%date:~7,2%
set std_out=output_%date_var%.log
set std_err=error_%date_var%.log

echo "Std out!" >> %std_out%
echo "Std err!" >> %std_err%
yammanuruarun
  • 403
  • 3
  • 9