My first post evidently did not materialize so I posted it again:
Runnning a cron job every 5 mins to send data files to a state facility.
My original cron entry at worked fine:
01,06,11,16,21,26,31,36,41,46,51,56 * * * * /home/sftpuser/stateinoc-from-appname.ksh
Somewhere I have a problem picking up all the files so I wanted to capture all output from the script into a log file so I did this:
01,06,11,16,21,26,31,36,41,46,51,56 * * * * MYDT=`date +%m%d%Y%H%M`;/home/sftpuser/appname-from-appname.ksh 2>&1 |/usr/bin/tee -a /tmpmsql/import/appname/statesinoc/StateInoc.$MYDT.log
I am not sure if the entrie cron is failing or if just the log file isd not getting created. When I do it from the command line, the log file gets created and filled with my verbose output from the script.
Is there something special to do with my syntax in the cron entry ?
Thread: Commands to call script work from command line but not from Cron entry Edit Post
---------- Post updated at 04:46 PM ---------- Previous update was at 04:38 PM ----------
I don't know why I had the "tee" in there. Probably used it while I was testing. I have since taken it out:
01,06,11,16,21,26,31,36,41,46,51,56 * * * * MYDT=`date +%m%d%Y%H%M`;/home/sftpuser/flshots-from-cerner.ksh 2>&1>/tmpmsql/import/appname/statesinoc/StateInoc.$MYDT.log