Start a new topic
Answered

Execute task is not working

The Execute task is not working for me, even for the 'cp' example I'm getting the following errors:

28 27/06/2018 16:03:14.618:tasks.ExecuteTask.Execute:Starting...

29 27/06/2018 16:03:14.619:tasks.ExecuteTask.Execute:item list size:2

30 27/06/2018 16:03:14.620:tasks.ExecuteTask.Execute:command before:cp

31 27/06/2018 16:03:14.620:tasks.ExecuteTask.Execute:argument before:{real_path}:/archive/{name}

32 27/06/2018 16:03:14.620:tasks.ExecuteTask.Execute:command after:cp

33 27/06/2018 16:03:14.620:tasks.ExecuteTask.Execute:argument after:/mnt/sftp/Activations_0002.csv:/archive/Activations_0002.csv

34 27/06/2018 16:03:14.621:tasks.ExecuteTask.Execute:Job task:Test Pusf files:91YJvy4ReOy2lhJPrlsz

35 27/06/2018 16:03:14.621:tasks.ExecuteTask.Execute:java.io.IOException: Cannot run program "c" (in directory "/mnt/sftp/Activation"): error=2, No such file or directory


If I use the full path to 'cp' the error is slightly different:

35 27/06/2018 16:11:11.018:tasks.ExecuteTask.Execute:java.io.IOException: Cannot run program "/" (in directory "/mnt/sftp/CDR/exports/biser/Activation"): error=13, Permission denied


CrushFTP Version 8.3.0 Build: 14

OS: CentOS 7.4



Best Answer

You have a blanks operator...you can't do that.  Think of the separator as the "space" when typing in a command line.  Except this isn't a command line, and we might legitimately have spaces in things.  So a unique character that is invalid in file paths is used...the semicolon.


Set your separator back to the default it was.  ;


Provide a screenshot of your task config.

image


separator should be semicolon.  ;


working directory should be /somewhere/ that exists.  Don't use real_path variable


argument would be:{real_path};/archive/{name}

You just attempted:


cp /mnt/activation/ /mnt/Activation/Archive/Activations_20002.csv 


That of course failed as it makes no sense.


The argument of the item you wanted to copy should be "{real_path}"


Command: /bin/cp

Argument: {real_path};/mnt/Activation/Archive/{name}

Working directory: /

Separator: ;


But other than explaining how arguments to CP work, you have things executing now.  No one would ever execute "cp" since we have a copy task though...

That was my mistake (wrong screenshot), trying hire with different locations and options. 

This is the real screenshot 

image


Answer

You have a blanks operator...you can't do that.  Think of the separator as the "space" when typing in a command line.  Except this isn't a command line, and we might legitimately have spaces in things.  So a unique character that is invalid in file paths is used...the semicolon.


Set your separator back to the default it was.  ;

Thanks Ben! That was it - now it's working as expected.

Login to post a comment