Please tell me what is wrong in the following shell script.
#!/bin/sh
DATE1=`date -d "yesterday" +"%Y-%m-%d"`
ssh ftwplapp01 << EOF
echo "Date is :" $DATE1 > /tmp/testfile
cd /app/was6/AppServer/logs/prod_ebp_live/ebp
tar cvf /app/was6/AppServer/logs/prod_ebp_live_applogs_$DATE1.tar `find . -name "*.log."$DATE1 -mtime -1`
EOF
DATE1 is not resolving under ssh. In other words, /tmp/testfile is not getting the value of $DATE1.
I'm getting following output:
was6@vmulport04:/app/weblogs/scripts> ./applogs_ftp.sh
Pseudo-terminal will not be allocated because stdin is not a terminal.
###############################################################################
Warning: These facilities are solely for the use of Authorized AIG Employees.
To protect systems from unauthorized use and to ensure that the system
is functioning properly, activities on this system are monitored and recorded
and subject to audit. Use of this system is expressed consent to such monitoring
and recording. Any unauthorized access or use of this system is prohibited and
could be subject to criminal and civil penalties.
###############################################################################
This server is participating in the eTrust project!
tar: Cowardly refusing to create an empty archive
Try `tar --help' or `tar --usage' for more information.
was6@vmulport04:/app/weblogs/scripts>
Please let me know what modification is needed to resolve this.
Thanks in advance.
Thanks,
Raja Yagna Narayanan T S