Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Unable to execute Unix command in Talend 7.0.1

Hi,

I have used the below command in UNIX and it workjed fine in unix command. But I don't know how to execute this same command from studio or TAC. My Talend studio runs on windows version and TAC runs on Unix version. 

find . -type f -newermt "2019-10-23 00:00:00" \! -newermt "2019-10-28 00:00:00" -exec cp {} /opt/Talend-7.0.1/runtime/archive/ \;

 

Hi friends,

Please help me to resolve the issue asap.

 

Tried the below,

tSSH --> tSystem

In tSSH, I have used tssh component and supplied the required credentials(However Iam not sure what is the password of the common user we access in dev unix box, so not sure what should I select in authentication method). 

In tSystem, I have used the the below commands and tried

Try 1:

find . -type f -newermt "2019-10-23 00:00:00" \! -newermt "2019-10-28 00:00:00" -exec cp {} /opt/Talend-7.0.1/runtime/archive/ \;

 

Try 2:

"find . -type f -newermt '2019-10-23 00:00:00' \! -newermt '2019-10-28 00:00:00' -exec cp {} /opt/Talend-7.0.1/runtime/archive/ \;"

 

Try 3:

"cmd /c find . -type f -newermt '2019-10-23 00:00:00' \! -newermt '2019-10-28 00:00:00' -exec cp {} /opt/Talend-7.0.1/runtime/archive/ \;"

 

please help me how to execute the command. My requirement is just to find a set of files from the timeframe and to move it to an archive folder. 

Trust I am clear with my requirement. Thanks in advance. 

 

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi
Can you try to escape the special characters such as ",\ in the command, eg:
"find . -type f -newermt \"2019-10-23 00:00:00\" \\! -newermt \"2019-10-28 00:00:00\" -exec cp {} /opt/Talend-7.0.1/runtime/archive/ \\;"

Take a look at the related topics:
https://community.talend.com/t5/Design-and-Development/tSystem-to-run-unix-commands-with-Tabcmd/m-p/...
https://community.talend.com/t5/Design-and-Development/Executing-a-Linux-command-with-a-pipe-using-a...

And you should run the job on Unix machine for testing.

Regards
Shong