Need help with Sudo command in Unix script
Hi There,
I have an etl job, with source as csv files.
My source team drops files at a location. I have an unix script, that moves these files to my source file directory. And loads these files one at a time.
When my source team does not send a file, my job fails.
So i want to put a dummy file, at a location where my src team drops files, when src team does not send a file.
it says donot have privilege, so I did a sudo still it is giving error below;
----------------------------------------
sudo su - etltest
cd /d11/OBISTG/obidata1/cos/ --- src team drops file here
filecount=`ls -lt AR_DATAMART_COS* | wc -l`
if [[ $filecount -eq 0 ]]; then
echo 'AR_DATAMART_COS.Dummy.99990101.000000.csv' > NavisionfileList.txt
fi
ls AR_DATAMART_COS* >>NavisionfileList.txt
-------------------------------------
Error:
sudo su - etltest
+ sudo su - etltest
sudo: sorry, you must have a tty to run sudo
any ideas pls?
Thanks,
Rag