1753528 Members
5171 Online
108795 Solutions
New Discussion

Re: Need ftp script

 
Dennis Handly
Acclaimed Contributor

Re: Need ftp script

>I have to manually execute the script.

 

Did you make the script executable?  chmod a+x /usr/sap/RDV/SYS/global/ftp/RMPA/ftpcptest.sh

Vishal_1980
Regular Advisor

Re: Need ftp script

Yes Dennis sir ,

I made the script executable.
Vishal_1980
Regular Advisor

Re: Need ftp script

This is the output :
# ll
total 2
-rwxrwxrwx 1 root sys 391 Jun 10 10:35 ftpcptest
Dennis Handly
Acclaimed Contributor

Re: Need ftp script

-rwxrwxrwx 1 root sys 391 Jun 10 10:35 ftpcptest

 

You should NOT make the file writable by everyone nor by group:

chmod go-w ftpcptest

 

If this is local and you're root, this should work, unless you have some unprintable chars in the crontab.

Use vis(1) to check:

crontab -l | vis

Vishal_1980
Regular Advisor

Re: Need ftp script

Hello SIr,

 

The script works good, however when the file is transfer through script the format is different.

And when it is ftp through SAP ftp application the format is different.My customer wants the same format as SAP ftp application.

 

Attaching both the files ,request you to please suggest on this.

Dennis Handly
Acclaimed Contributor

Re: Need ftp script

>My customer wants the same format as SAP ftp application.

 

The two files seem to be input files and appear to be the same.

Vishal_1980
Regular Advisor

Re: Need ftp script

No sir both the inputs files are different.If you open it in notepad you will come to know.
The file which is ftp through script,the info comes in 1 single line,
where as the file transferred by the SAP ftp application was in a proper human readable format.Request you to please suggest for the same or please share me your mail id i will send those files to you.

Thanks,

Vishal
Dennis Handly
Acclaimed Contributor

Re: Need ftp script

>If you open it in notepad you will come to know.

 

I don't use notepad for that reason.  :-)

 

Basically you copied the file in binary mode so it kept the LF terminator.  Evil Windows wants CR/LR.

 

In the script I provided, change the line with "bin" to "ascii".

You need to be aware that ALL files will be transferred this way and would be assumed to be text files.

Vishal_1980
Regular Advisor

Re: Need ftp script

Dear Sir,

I made the changes suggested by you & waiting for customers feedback.
However i wonder when i will become a good on scripting...
I want to learn it from basics ..please suggest me on this....

Thanks
Vishal
Vishal_1980
Regular Advisor

Re: Need ftp script

Hello expert,

client need one more thing ,that whenever the script runs one mail should be triggered >how possibly could i do that this.
Please suggest .
Thanks & regards
Vishal