Hi,
I have to transfer files to a remote Linux server. There were some threads about the Download tool, but it seems to require a URL field within the file(?) Our files won't have that. Is there a way we could simply ssh into the server and run a remote scp command?
Thanks,
Gayatree
You can leverage the Run Command tool to achieve this. Use Alteryx to create a .bat file dynamically which then calls a third party executable such as plink.exe to ssh into the Linux server and copy the file across.
@MichalM ,
Thank you! Will look into this. Do you have any examples I could peruse in the meantime?
I've attached an example. Here're the logical steps you need to follow
1. Save the file you would like to upload in a location that you can reference downstream in your workflow.
I use a combination of the Formula tool and the dynamic output functionality of the Output data tool to achieve this
- Use the Formula tool to define the output path
- Use this to overwrite the output path and remove the field from the output file in the process
2. Generate your SCP script (in case it needs to be dynamic)
I use a batch macro to do this because I want to make sure that the script is written before I try to use it in my plink command.
- I use the Summarise tool and Group by the output path to get a single row with the path. I then pass it into the macro through the Control parameter
- I then use this to update a value in my script - the placeholder is entered as a header of a Text Input tool
scp FILEPATH michalm@servername.alteryx.com://remote/directory
- Once updated, I save the file as scp.txt which is then referenced as the command file for the plink command
- I use the Append fields tool to create a dependency - making sure that the scp command is updated before I pass the plink command out of the macro. You can download plink.exe from here.
c:\commands\plink.exe -ssh servername.alteryx.com -l michalm -pw @lteryx -m c:\commands\scp.txt
3. Save the plink command as a .bat file and execute it using the Run Command tool
- The Output configuration of the Run Command tool allows you to save the data flowing into the tool (plink command in our case) as a .bat file.
- The Command portion is used to reference the .bat file which is created on the fly as defined above
I hope it makes sense.
Hi @MichalM ,
I am trying same. I just want to copy a file from remote server and write it on snowflake/tableau. I see in your design flow you have used many extra things. Is there any element which just ssh and copy. Also I tried to implement your flow. however I am seeing can't access folder and nowhere I am providing authentication to ssh the server.
Can you please help me???
@MichalM Any luck??
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |