Skip to Content

Shell Script for the deletion of the file in FTP Protocol

Hello ,

For some reason , I have to delete file from R/3 Application server and so i am using a shells script to do that.

Its a file to file  scenario and sender is FTP protocol.

The code is as follows.

logDir= /interface/scripts

logFile=deleteMATMASTFiles.log

host="pand0114.pan.eu"

open ${host}

cd /interface/tes

currDate=`date`

a="makt_EN_material_descr"

rm $a

and the command in the channel is :

The log shows that it executes the OS Command , but the file does not get deleted.

Can someone help me here !!

Regards,

Ravi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jun 29, 2012 at 07:06 AM

    Hi Ravi,

    Use the method described by Michal in one of his blogs, to catch the results of shell script commands into some log file. See more details here:

    XI: Operation system command - error catching

    Michal's examples are related to Windows platform, but same can be applied to Unix as well.

    Regards,

    Greg

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 28, 2012 at 10:08 PM

    Hi,

    It seems it don't have access to delete file , please check the access. try to run directly the shell on FTP to verify.

    Also ist the file "makt_EN_material_descr" is without extension?

    Regards

    Lucho

    Add comment
    10|10000 characters needed characters exceeded

    • >When i try to ftp R/3 remotely from PI , then the files in the folder are not displayed

      This shows that your ftp user login does not have access to view or delete those files in that directory. Thats the reason you are not able to perform delete operation.  Please check with system admin and provide this information.  They will provide full access for the user to take control on the directory.  This is not file permission.

  • avatar image
    Former Member
    Jun 29, 2012 at 04:07 AM

    Hi Ravi,

    I think you want to delete the file after pulling the file by sender comunication channel.

    if this the case then you don't have to use any shellscript. You can set "Processing Mode" to "DELETE" in sender communication channel. This option is in processing tab.

    Please correct me if I have misunderstood your requirement.

    Regards,

    Nayan

    Add comment
    10|10000 characters needed characters exceeded