on 06-28-2012 10:44 PM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would recommend two things. Use delete command for single file deletion or mdelete command for multiple files. Your FTP user should have permission to execute this function on the remote machine. For ftp commands please see this link
http://www.ftp-commands.com/file-transfer-protocol/delete+remote-file/?q=delete+remote-file
Hi Luis,
In the code we have given a log to generate .
The log files executes all the commands till the end, but the file does not get deleted from the folder.
Could you please check the code and let us know whats wrong :
logDir= /interface/scripts
logFile=deleteMATMASTFiles.log
echo "Entered script" >> $logDir/$logFile
host="pand0114.pan.eu"
open ${host}
cd /interface/tes
currDate=`date`
a="makt_EN_material_descr"
rm $a
echo "$currDate - SUCCESS-File is deleted" >> $logDir/$logFile
Hello Baskar,
In the code we have given a log to generate .
The log files executes all the commands till the end, but the file does not get deleted from the folder.
Could you please check the code and let us know whats wrong :
logDir= /interface/scripts
logFile=deleteMATMASTFiles.log
echo "Entered script" >> $logDir/$logFile
host="pand0114.pan.eu"
open ${host}
cd /interface/tes
currDate=`date`
a="makt_EN_material_descr"
rm $a
echo "$currDate - SUCCESS-File is deleted" >> $logDir/$logFile
The script code looks good. Check with Basis or Unix admin about file permission that requires deletion. The file permission may not be sufficient for deleting. Just for test purpose give commnad before you run the script.
chmod 777 makt_EN_material_descr
Also ask unix admin that is this FTP user requires permission to delete the file.
Hello Baskar ,
As mentioned in your last few replies, i tried everything by checking the permission of the file with Basis and also by delete command .
The permission is full ( 777 ) and even the log file gets generated till the end .
But the file still exists on the folder. and its still not deleted.
When i try to ftp R/3 remotely from PI , then the files in the folder are not displayed. However, if i try to run the script from the machine on which my PI server is , then i am able to list the files and delete the files as well.
Not sure, if i am able to login remotely and access the file.
Regards,
Ravi
>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.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.