Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
richie1985
Contributor
Contributor

tSCPDelete Folder

Hi,

 

it seems at the moment its not possible to remove a folder via tSCPDelete:

 

rm: cannot remove '/volume1/Profile/axel.kr.V2': Is a directory
Exception in component tSCPDelete_1 (test_activedirectory_delete)
java.lang.RuntimeException: File(s) deleting failed.Exit code: 1
	at t4y.test_activedirectory_delete_0_1.test_activedirectory_delete.tIterateToFlow_1_AIProcess(test_activedirectory_delete.java:7432)
	at t4y.test_activedirectory_delete_0_1.test_activedirectory_delete.tSCPFileList_1Process(test_activedirectory_delete.java:4566)
	at t4y.test_activedirectory_delete_0_1.test_activedirectory_delete.tSCPConnection_1Process(test_activedirectory_delete.java:4065)
	at t4y.test_activedirectory_delete_0_1.test_activedirectory_delete.tMysqlInput_1Process(test_activedirectory_delete.java:3867)
	at t4y.test_activedirectory_delete_0_1.test_activedirectory_delete.tMysqlConnection_1Process(test_activedirectory_delete.java:1442)
	at t4y.test_activedirectory_delete_0_1.test_activedirectory_delete.tLDAPConnection_2Process(test_activedirectory_delete.java:1269)
	at t4y.test_activedirectory_delete_0_1.test_activedirectory_delete.runJobInTOS(test_activedirectory_delete.java:7950)
	at t4y.test_activedirectory_delete_0_1.test_activedirectory_delete.main(test_activedirectory_delete.java:7793)

i want to delete automaticly about 1500 folders 0683p000009MPcz.png

 

0683p000009M3N6.png

 

Thx!

 

Erik

 

Labels (3)
1 Solution

Accepted Solutions
akumar2301
Creator III
Creator III

Hello ,

 

try below line in tJava instead of tSCPDelete

 

below code worked for me :

 

ch.ethz.ssh2.Session session = ((ch.ethz.ssh2.Connection)globalMap.get("conn_tSCPConnection_1")).openSession();

session.execCommand("rm -r /home/xxxxxx/abc");

int returnCondition = session.waitForCondition(ch.ethz.ssh2.ChannelCondition.EXIT_STATUS,300L);

 

Let me know if works.

 

View solution in original post

4 Replies
fdenis
Creator III
Creator III

check user right, can you do it manually using scp?
richie1985
Contributor
Contributor
Author

of course user has rights... problem is that the tSCPDelete will create command like "rm /path/folder" but to delete a folder it must be "rm -r /path/folder"

akumar2301
Creator III
Creator III

Hello ,

 

try below line in tJava instead of tSCPDelete

 

below code worked for me :

 

ch.ethz.ssh2.Session session = ((ch.ethz.ssh2.Connection)globalMap.get("conn_tSCPConnection_1")).openSession();

session.execCommand("rm -r /home/xxxxxx/abc");

int returnCondition = session.waitForCondition(ch.ethz.ssh2.ChannelCondition.EXIT_STATUS,300L);

 

Let me know if works.

 

richie1985
Contributor
Contributor
Author

awesome! thank you so much!