I loaded a find command into autosys. It zips anythin older than 15 days old. The script only has two lines.
#!/bin/bash
find /casper/dir/usa.* -type f -mtime +15 -exec gzip --verbose {} \;
Problem is that is finished successfully immediately, but continues to run and writes everything to the error file.
casperrd@usa04 1026$ ls -ltr /unity_apps/casperrd/logs/autosys/*CASPER_JOB_AUTOSYS*
-rw-r--r-- 1 capsergrp casper 0 Aug 21 16:35 /unity_apps/casperrd/logs/autosys/CAPSER_JOB_AUTOSYS_20180821_20:35:20.out
-rw-r--r-- 1 capsergrp casper 662 Aug 21 16:43 /unity_apps/casperrd/logs/autosys/CAPSER_JOB_AUTOSYS_20180821_20:35:20.err
casperrd@usa04 1027$
I need to show what files are zipped, and want it to write to the .out file, not .err file
cat /unity_apps/casperrd/logs/autosys/CAPSER_JOB_AUTOSYS_20180821_20:35:20.err
/casper/log/casperjob.20180622.txt: 94.2% -- replaced with /casper/log/casperjob.20180622.txt.gz
/casper/log/casperjob.20180625.csv: 74.6% -- replaced with /casper/log/casperjob.20180625.csv.gz
/casper/log/casperjob.20180625.txt: 94.2% -- replaced with /casper/log/casperjob.20180625.txt.gz
/casper/log/casperjob.20180626.csv: