HOw to delete files from remote server?
Hi,
I want to delete files from a directory on remote server.
I use the following command to delete on current server:
find $srcdir -mtime +90 -name "COR*.txt" -exec rm -f {} \;
Now, how can I delete files from remote server ?
Thanks!
Yogini
Some possible options:
1. There exists SSH implementation for Windows.
2. You can make a workaround. You can setup share for specific/wanted directory.
Then you can mount it on Linux machine and execute command localy and delete files "localy" in mounted directory.
3. You can setup FTP server on Windows machine and do that remotely via FTP commands.
Similar Messages
-
How to delete file from Window server
Hi
Can anybody tell me that Is there any function module for deleting file from presentation server like C directory.
Quick suggestion will highly be appreciated!!!!!!!Try this:
CALL METHOD cl_gui_frontend_services=>file_delete
EXPORTING
filename =
changing
rc =
EXCEPTIONS
FILE_DELETE_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
FILE_NOT_FOUND = 4
ACCESS_DENIED = 5
UNKNOWN_ERROR = 6
NOT_SUPPORTED_BY_GUI = 7
WRONG_PARAMETER = 8
others = 9
this is pretty gud approach .
Message was edited by:
Nishant Rustagi -
How to delete file from application server(Unix)
Hi All,
Using the below code downloading a file from application server(Unix) to client machine. I want to delete the file from application server once it is downloaded to client
We work on Forms 11.1.1.4.0 and Oracle DB 10g. Client machine are Windows 7.
BEGIN
IF webutil_file_transfer.AS_to_Client
(clientFile => Name_In('global.g_file_name')
,serverFile => ls_AppServer_Loc)THEN
message('Data exported Successfully');
ELSE
message('File download from Application Server failed');
END IF;
EXCEPTION
WHEN OTHERS THEN
message('File download failed: '||SUBSTR(sqlerrm,1,200));
END;
I have search for solution on OTN. Few suggested to use HOST.
Can any one help me how to use Host() built_in to delete the file.
Thanks,
MaddyCan any one help me how to use Host() built_in to delete the file.
Host('/bin/rm <complete file path>'); -
How to delete files from application server posted in last 30 days
I have some files in application server posted through ABAP program with the below format
\.\.\.abcd_20110209_111209.csv (with date and time). I need to delete those files which was posted in last 30 days through another program. Could you plaese help me to achieve the requirement?There are many ways you can delete/archive files in application servers.
1. Depending on the application server, usually administrators setup delete/archive programs. For e.g. if the application server is a UNIX, then the unix admin will write a script to delete/move older files. - this is the most common approach I've seen.
If you have to achieve this through ABAP then,
1. You can get the script from the server admin and then use that script to create an external system command through SM69/49 and use the function module SXPG_COMMAND_EXECUTE to execute it.
2. You can also look at FM EPS_DELETE_FILE and see if it fits the bill for you.
There are many other possibilities too and each one has its own pros/cons. So you'll have to choose the right one for your requirement. -
Deleting file from application server
can any one tell me how to delete file from application server?
Hi,
Use statement
delete dataset 'tmpfile.txt'.
\tmp\file.txt is the file path on application server which you want to delete.
Regards
Sailaja. -
Process Chain - Delete File from Application Server
Hi Gurus,
Im working with Process chain, and i have a load from a flat file, so my question is :
How can i delete that file from the application server after was loaded ?
THANKS IN ADVANCED !!! I REALLY APRECCIATE YOUR HELP.
Marcoshi,
I have gone through the forum you have posted for deleting files from application server through process chain.
I have similar reuirement in my project.
Can you please provide me the solution?
Your inputs will be highly appreciated.
Thanks in advance.
Regards,
Lavanya. -
T-code for delete file from application server
Hi all!
Please, has any t-code for delete file from application server? For upload exist CG3Z, for download has CG3Y. And for delete? Has anyone?
I need to delete file from application server in QA system and i don't want to create a program for this because i will need to transport a request from DEV to QA.I don't have contact with basis team.
The FM EPS_DELETE_FILE support directory name with max 60 char. My dir. has more than that. I need a transaction for this.
Anybody know if this transaction exist? -
HOW TO DELETE FILES FROM ADOBE READER IF THEY ARE UNNECESSARY
HOW TO DELETE FILES FROM ADOBE READER IF THEY ARE UNNECESSARY
Hi,
You might need to sign up at https://cloud.acrobat.com/ and choose 'Files' tab where you can find all the files.
Select all the files you want to remove and choose 'Delete' option.
Regards,
Anubha -
How to delete file on ftp server
hello,how to delete file on ftp server?thank you!
I was trying to hint to the fact that you gave no where near enough information.
Have you already written anything? Such as software that will connect to an FTP server?
Are you using a 3rd party package?
Are you doing it by hand, using sockets? -
How to download file from application server
Hi Experts,
I developed report and execute in background mode. for this i used Open dataset transfer and close dataset . i got the requried output . But in this case user want downloaded file on presentation server so can anyone tell me How to download file from application server?
i know it is possible through Tcode CG3Y. but i want code in program.This code will download a file to your Client package by package, so it will also work for huge files.
*& Report ZBI_DOWNLOAD_APPSERVER_FILE
REPORT zbi_download_appserver_file.
PARAMETERS: lv_as_fn TYPE sapb-sappfad
DEFAULT '/usr/sap/WBP/DVEBMGS00/work/ZBSPL_R01.CSV'.
PARAMETERS: lv_cl_fn TYPE string
DEFAULT 'C:\Users\atsvioli\Desktop\Budget Backups\ZBSPL_R01.CSV'.
START-OF-SELECTION.
CONSTANTS blocksize TYPE i VALUE 524287.
CONSTANTS packagesize TYPE i VALUE 8.
TYPES ty_datablock(blocksize) TYPE x.
DATA lv_fil TYPE epsf-epsfilnam.
DATA lv_dir TYPE epsf-epsdirnam.
DATA ls_data TYPE ty_datablock.
DATA lt_data TYPE STANDARD TABLE OF ty_datablock.
DATA lv_block_len TYPE i.
DATA lv_package_len TYPE i.
DATA lv_subrc TYPE sy-subrc.
DATA lv_msgv1 LIKE sy-msgv1.
DATA lv_processed_so_far TYPE p.
DATA lv_append TYPE c.
DATA lv_status TYPE string.
DATA lv_filesize TYPE p.
DATA lv_percent TYPE i.
"Determine size
SPLIT lv_as_fn AT '/' INTO lv_dir lv_fil.
CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
EXPORTING
file_name = lv_fil
dir_name = lv_dir
IMPORTING
file_size_long = lv_filesize.
"Open the file on application server
OPEN DATASET lv_as_fn FOR INPUT IN BINARY MODE MESSAGE lv_msgv1.
IF sy-subrc <> 0.
MESSAGE e048(cms) WITH lv_as_fn lv_msgv1 RAISING file_read_error.
EXIT.
ENDIF.
lv_processed_so_far = 0.
DO.
REFRESH lt_data.
lv_package_len = 0.
DO packagesize TIMES.
CLEAR ls_data.
CLEAR lv_block_len.
READ DATASET lv_as_fn INTO ls_data MAXIMUM LENGTH blocksize LENGTH lv_block_len.
lv_subrc = sy-subrc.
IF lv_block_len > 0.
lv_package_len = lv_package_len + lv_block_len.
APPEND ls_data TO lt_data.
ENDIF.
"End of file
IF lv_subrc <> 0.
EXIT.
ENDIF.
ENDDO.
IF lv_package_len > 0.
"Put file to client
IF lv_processed_so_far = 0.
lv_append = ' '.
ELSE.
lv_append = 'X'.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = lv_package_len
filename = lv_cl_fn
filetype = 'BIN'
append = lv_append
show_transfer_status = abap_false
TABLES
data_tab = lt_data.
lv_processed_so_far = lv_processed_so_far + lv_package_len.
"Status display
lv_percent = lv_processed_so_far * 100 / lv_filesize.
lv_status = |{ lv_percent }% - { lv_processed_so_far } bytes downloaded of { lv_filesize }|.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING "percentage = lv_percent - will make it fash
text = lv_status.
ENDIF.
"End of file
IF lv_subrc <> 0.
EXIT.
ENDIF.
ENDDO.
"Close the file on application server
CLOSE DATASET lv_as_fn. -
How to transfer file from application server to presentation server in background?
Hi Experts,
How to transfer file from application server to presentation server in background?
Thanks in advance
NamitaThanks Raman and Challa,
We want to move file from application server to Shared folder, not on local machine. We checked FM which you guys have provided but those are not able to read file from application server.
We need this program to run in background so that we can use this in daily process chain.
Appreciate your inputs on this.
Thanks,
Namita -
How to upload file from Application Server?
Dear Friends,
How to upload file from Application Server?
Plz. with example...
Regards,
Dharmeshhi,
check the code for upload from application server.
tables: kna1.
types: begin of s_file,
customer type kna1-kunnr,
country type kna1-land1,
name type kna1-name1,
region type kna1-regio,
end of s_file.
*--Internal tables
data: it_file type s_file occurs 0 with header line.
*-- Selection screen
selection-screen: begin of block b1 with frame title text-001.
parameter: p_file type rlgrap-filename default 'C:/customer.txt'
obligatory.
selection-screen: end of block b1.
*-- At selection screen
at selection-screen on value-request for p_file.
perform file_help using p_file.
*-- Process File
start-of-selection.
perform upload_file using p_file.
*-- write File data to o/p
end-of-selection.
perform write_data.
*& Form file_help
form file_help using p_p_file.
data: l_filepath type ibipparms-path.
call function 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
importing
file_name = l_filepath
p_p_file = l_filepath.
endform. " file_help
*& Form upload_file
form upload_file using p_p_file.
call function 'WS_UPLOAD'
exporting
filename = p_p_file
filetype = 'DAT'
IMPORTING
FILELENGTH =
tables
data_tab = it_file
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
others = 11
if sy-subrc <> 0.
message i001.
endif.
endform. " upload_file
*& Form write_data
form write_data .
loop at it_file.
write:/ it_file-customer, it_file-country, it_file-name,
it_file-region.
endloop.
endform.
regards,
keerthi. -
Delete file from application server
Hi,
Can any one tell me how to delete a file from application server?
Thanks,
Rahul.Basic question, please search for available information.
Thread locked.
Thomas -
How to read file from remote machine
Hello,
Hi, i would like to know how to read text file from remote machine using java source code, any code ?
Thanks very much;
Best regards
KimOn the server, perform the following steps:
Parse the request and determine the file to serve
Open a FileInputStream to the appropriate file
Obtain a reference to the Servlet OutputStream
Pipe the bytes from the file to the output stream
Flush and close the streamYou might want to call HttpServletResponse.setContentType("application/octet") to indicate to the browser that a file download will be occurring. Do so before getting the reference to the Servlet's OutputStream.
- Saish -
How to copy file from application server
Hello experts,
How to copy file from one folder of application server and paste it to other folder of application server(application server is same)?
Is there any function module exists???
thanks in advance
SaurabhHi you can use this function module to move a file from application server to another folder on application server.
call function 'WS_FILE_COPY'
exporting
destination = m_destination
source = m_source
importing
return = return.
Plus u can use this function module to delete the file from that folder from which u want to replace it.
call function 'WS_FILE_DELETE'
exporting
file = m_source
importing
return = return.
The above FM can help u copy a file from one folder to another and delete the file from that folder.
Maybe you are looking for
-
I've rebooted both my Macbook and the phone, restored the phone to new, and restored it from my last backup and still nothing helps the issue. It is visible in itunes but won't allow me to move media on to it. Any suggestions?
-
I first tried to update my ipad 2, running currently on iOS 4.3.3, to iOS 5 but iTunes keep telling me that an unknown Error 3194 has occurred. I uninstalled iTunes and installed it again. I restarted my laptop, but still the same message. How can I
-
How do I connect to a DB2 database from Oracle 10G on linux?
Hi I have tryed to connect to a DB2 database from oracle 10 G on linux. I have installed unixODBC and a db2 odbc driver. I can connect to the db2 using isql, but oracle comes with this error: select * from testtable@acc_spc_gr2 ERROR at line 1: ORA-2
-
HELP! Why do my iPad Photos Scramble each time I Sync?
HELP! Each time I sync my iPad photos, my previous albums' organization scrambles (the order I've arranged my photo albums scrambles). THIS IS WHAT I DO: On my iPad, I tap the PHOTOS app, then tap ALBUMS to see each of the albums I've created. I then
-
Query on File() constructor parameter
I have a query on the File(String pathname) constructor. Could anyone advise me why its parameter is the pathname? Is the pathname has included the file's name? String mypahtname = "c:\\folder\\"; String myfilename = "abc.txt"; String mystring = mypa