2013-12-23 02:57 AM
Is anybody have an updated and working nicsftpagent.sh script for SAP (Based on Unix) integration with RSA SA then please upload here, the script which i got form Knowledgebase in not working showing an error when i run that script in unix.
2013-12-26 09:55 AM
i know whats the problem as i simulated the issue with your config file.
The conf file contains the special char "CR", please remove all of them.
You can use notepad++, search for '\r' the replace with ''
2013-12-23 04:12 AM
which version is yours? I just downloaded which is - Automated FTP/SCP/SFTP Script v2.7.12.
Did you configure the required parameters?
2013-12-23 04:55 AM
2013-12-23 05:03 AM
there are two locations in the script which contains the errors:
Can you check whether the NIC folder exists or Data Dir?
### Test that NIC directory exists
if [ ! -d "$NIC_DIRECTORY" ]
then
echo "$NIC_DIRECTORY cannot be found."
exit 1
fi
PWD=`pwd`
### Test that each of the data directories exists
for d in `echo "$DATA_DIRECTORY" | awk '{split($0, a, ":"); for (i in a) print a; }'`
do
if [ ! -d $d ]
then
echo "$d cannot be found."
exit 1
elif [ -d "$NIC_DIRECTORY$d" ]
then
# Clear out old tracking files
2013-12-23 09:15 AM
Hi Patriot,
Thanks for the help but I am still confused which file I have to delete and yes Nic directory is exist in /usr/local/nic and data directory is also exist which I have write in conf file.
2013-12-24 12:52 PM
Hi patriot,
can you tell me which line i have to delete or if you have any updated script then please upload here.
2013-12-24 01:21 PM
i don't think you need to delete any line. we're using the same file.
can you run this:
sh -x nicsftpagent.sh
it will output all the details.
2013-12-26 07:39 AM
i got the same output even with your script.
apecchrt:/usr/local/nic # ./nicsftpagent.sh
cannot be found.
apecchrt:/usr/local/nic # sh -x nicsftpagent.sh
+ PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/css/bin:/sbin:/usr/sbin:/usr/local/sbin: /root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/u sr/lib/mit/bin:/usr/lib/mit/sbin
+ ENVISION=10.10.30.187
+ DATA_DIRECTORY=/usr/sap/ECH/DVEBMGS00/log
+ ENVISION_DIRECTORY=SAP_44
+ NIC_DIRECTORY=/usr/local/nic
+ TRANSFER_METHOD=FTP
+ USERNAME=anonymous
+ PASSWORD=default
+ IDENTITY=/root/.ssh/id_rsa
+ FILESPEC='rsa_sap_audit*'
+ UPLOAD_SPEC=tmp
+ FLAG_REMOVE_FILE_AFTER_SEND=no
+ NUMBER_OF_OUTPUT_LINE_ON_SFTP_SUCCESS=6
+ NUMBER_OF_OUTPUT_LINE_ON_FTP_SUCCESS=3
+ NIC_CONFIG=nicsftpagent.conf
+ SCRIPT_NAME=nicsftpagent.sh
+ KILL_RUNNING_AFTER=300
+ USETAIL=0
+ USEHEAD=0
+ '[' -f /usr/local/nic/nicsftpagent.conf ']'
+ . /usr/local/nic/nicsftpagent.conf
++ SILENT=$'true\r'
++ ENVISION=$'10.10.30.187\r'
++ ENVISION_DIRECTORY=$'SAP_10.10.28.44\r'
++ DATA_DIRECTORY=$'/usr/sap/ECH/DVEBMGS00/log\r'
++ NIC_DIRECTORY=$'/usr/local/nic\r'
'+ FILESPEC='rsa_sap_audit*
++ TRANSFER_METHOD=$'SFTP\r'
++ USERNAME=$'nic_sshd\r'
++ NUMBER_OF_OUTPUT_LINE_ON_FTP_SUCCESS=$'3\r'
+ '[' $'xtrue\r' = x ']'
+ '[' -f $'/usr/local/nic\r/running10.10.30.187\r' ']'
++ date +%Y%m%d%H%M%S
+ TIMENAME=20131226144923
+ '[' $'xtrue\r' = x ']'
+ '[' '!' -d $'/usr/local/nic\r' ']'
cannot be found.'/nic
cannot be found.
+ exit 1
apecchrt:/usr/local/nic #
2013-12-26 09:55 AM
i know whats the problem as i simulated the issue with your config file.
The conf file contains the special char "CR", please remove all of them.
You can use notepad++, search for '\r' the replace with ''
2013-12-26 10:41 AM