Automic Workload Automation

 View Only
  • 1.  How to rename multiple files from FTP job in UC4

    Posted Aug 25, 2021 12:03 PM
    Hi team, 


    I need to remove a prefix from the filenames one after other within a directory.  Plan to do it from 'freeform command' which is available in FTP job. 
    Tried with the below command.
    •           for file in Sample*.xlsx; do mv "$file" "${file#Sample}"; done;

    But getting the below error, can anyone suggest me how to resolve the issue.

    sendCommand not supported for sftp
    com.uc4.ftpjob.DataTransferException: Error skipping file bytes.
    at com.uc4.ftpjob.commands.FtpFacadeCommandImpl.throwDataException(FtpFacadeCommandImpl.java:57)
    at com.uc4.ftpjob.commands.FtpFacadeCommandImpl.sendCommand(FtpFacadeCommandImpl.java:95)
    at com.uc4.ftpjob.commands.impl.FreeFormFTPCommand.execute1(FreeFormFTPCommand.java:247)
    at com.uc4.ftpjob.commands.impl.FreeFormFTPCommand.execute(FreeFormFTPCommand.java:40)
    at com.uc4.ftpjob.commands.CommandProcessor.execCommand(CommandProcessor.java:308)
    at com.uc4.ftpjob.commands.CommandProcessor.processCommands(CommandProcessor.java:164)
    at com.uc4.ftpjob.commands.CommandProcessor$processCommands.call(Unknown Source)
    at FtpJob.runJob(FtpAgent.groovy:320)
    at com.uc4.extensibility.types.CITAgent.dispatchJob(CITAgent.java:258)
    at com.uc4.ex.cit.CITJob.execute(CITJob.java:194)
    at com.uc4.ex.Job.run(Job.java:469)
    at com.uc4.ex.ThreadPool$RunnableDecorator.run(ThreadPool.java:53)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.UnsupportedOperationException: sendCommand not supported for sftp
    at com.uc4.ftpjob.commands.SFtpCommandImpl.sendCommand(SFtpCommandImpl.java:361)
    at com.uc4.ftpjob.commands.FtpFacadeCommandImpl.sendCommand(FtpFacadeCommandImpl.java:93)

    Thanks in advance.


  • 2.  RE: How to rename multiple files from FTP job in UC4

    Broadcom Employee
    Posted Aug 25, 2021 07:53 PM
    Hi @rama kishore,

    Please take a look at the supported free form commands.

    Cheers,
    Alexander