Lucee, Ubuntu & CFEXECUTE

Hello, this may be a “Noob question”, but I’m new to Linux/Ubuntu…

I’m trying to run the following command(s) via CFEXECUTE to copy a file with scp from A to B (works fine via SSH/command line):

Version 1:

<cfexecute name="scp" arguments="/var/www/filetocopy.csv root@10.10.10.10:/var/lib/mysql-files/" outputfile="outfile" timeOut="30" />

Result:

java.io.IOException: Cannot run program “scp”: error=2, No such file or directory

Version 2:

Execution of copy.sh with the following content:

scp /var/www/filetocopy.csv root@10.10.10.10:/var/lib/mysql-files/

<cfexecute name="/var/www/copy.sh" outputfile="outfile" timeOut="30" />

Result:

lucee.commons.cli.CommandException: /var/www/copy.sh: 1: scp: not found

Version 3:

After copying scp to /var/www:

<cfexecute name="scp" arguments="/var/www/filetocopy.csv root@10.10.10.10:/var/lib/mysql-files/" outputfile="outfile" timeOut="30" />

Result:

lucee.commons.cli.CommandException: /var/www/scp: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38’ not found (required by /var/www/scp)

I’m quite sure this is only a path issue or something similiar trivial, but I’m thankful for any hint!

Regards,
RG

Don’t forget to tell us about your stack!

OS: Ubuntu 24.04.1 LTS
Java Version: OpenJDK 11.0.24+8
Tomcat Version: 9.0.96
Lucee Version: 6.1.1.118

isn’t the path /usr/bin/scp ?

1 Like

While /usr/bin/scp is existing, cfexecute name="/usr/bin/scp" gives java.io.IOException: Cannot run program “/usr/bin/scp”: error=2, No such file or directory. Looks like a rights issue?

can you do a sudo locate scp on the server and check where the binary file sits? I don’t have any old Ubuntu installation around

Sorry, it’s Ubuntu 24.04.1 LTS.

sudo locate scp does not work on this box (“sudo: locate: command not found”), but /usr/bin/scp is existing, see my post above.

For future reference because locate is such a handy tool:

sudo apt install locate

But as you said, you already know its path, so yes it’s likely that your installation of Lucee was not installed as root.

You might need to refactor how you scp such as via shell script that runs every minute via Cron or something that monitors for new files added to a folder and handles those events.

under which account does lucee run? Please check as well the rights for scp which is for me -rwxr-xr-x 1 root root 133720 Jun 26 2024 /usr/bin/scp

if it is just about scp, lucee should support sftp connections, maybe that’s the better approach?

  • can the source file permission be read? (if not, put source file in a folder that the current user owns and try)
  • can the destination folder permission be written to by your user? (if not, copy to the home directory of the user account you are signing in with and try; i.e. you need permission for john, then try scp /home/join/file.tar john@10.10.10.10:/home/john)
  • do you need to include a private key with your scp command ?(with -i switch leading to full path of key file)
1 Like