Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > File Transfer

Reply
 
Thread Tools Display Modes
  #1  
Old 08-30-2019, 03:41 AM
clark_c clark_c is offline
Registered User
 
Join Date: Aug 2019
Posts: 4
Having trouble transferring files via cmd line

I can transfer files successfully via SecureFX 8.5 GUI but cannot manage to do it via cmd line.

The cmd line code I'm using is as follows:

Code:
sfxcl /NOPROMPT /RETRYCOUNT 0 D:\PathToFiles\rt_*.zip sftp://User:Psswrd@hostname/DestinationFolder/
I also tried using this too:

Code:
sfxcl /AcceptHostKeys /NoPrompt / RetryCount "0" /F "sfxcl_config_location" /I "sfxcl_keyfile_location" /Password passwrd /P passph "PathToFileLocation\rt_*.zip" sftp://user@hostname//DestinationFolder/
Reply With Quote
  #2  
Old 08-30-2019, 07:55 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,972
Hi clark_c,

Please add /Log "path_to_log_file.txt" after sfxcl and send the full log that is generated to support@vandyke.com.

In SecureFX's GUI, you can configure logging to a file in the File Transfer / Options / Advanced category of SecureFX's Global Options. Please do that, capture the success case and attach that log to your email also.

Please reference Attn Brenda - Forum Thread #13893 in your email.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 09-10-2019, 09:26 AM
clark_c clark_c is offline
Registered User
 
Join Date: Aug 2019
Posts: 4
Hi Brenda,

I managed to get it working on the cmd line but I am having issues getting it to work with task scheduler.

Task Scheduler runs everything in the batch file except the below line:

Code:
sfxcl /NOPROMPT /LOG "%LOGFILE%" D:\PathToFiles\rt_*.zip sftp://User:Psswrd@hostname/DestinationFolder/
The batch file runs fine by itself, do you have any idea why the above line wont run in task scheduler?

Thanks,

clark_c
Reply With Quote
  #4  
Old 09-10-2019, 09:34 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,972
Hi clark_c,

No, I don't. Do you get an error? If so, what's the error?

Is the log file created when run from Task Scheduler? If so, either post the log file (sensitive data redacted) or send it to support@vandyke.com (Attn Brenda - Forum Thread #13893 in subject line).
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 09-11-2019, 07:24 AM
clark_c clark_c is offline
Registered User
 
Join Date: Aug 2019
Posts: 4
If I have the log file code by itself followed by some thing like
Code:
echo hello > "%LOGFILE%"
It will work fine but for
Code:
sfxcl /NOPROMPT /LOG "%LOGFILE%" D:\PathToFiles\rt_*.zip sftp://User:Psswrd@hostname/DestinationFolder/
No log file is generated as the whole line does not get executed.
Reply With Quote
  #6  
Old 09-11-2019, 09:23 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,972
Hi clark_c,

That may be a red herring, but what is the line where you defined LOGFILE in the batch file?

You might also need to add the /F "Path_to_config" option to point to SecureFX's config.

See also our YouTube video that illustrates using SecureFX saved sessions, which is often a better choice so that sensitive user data is not at risk.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #7  
Old 09-13-2019, 05:16 AM
clark_c clark_c is offline
Registered User
 
Join Date: Aug 2019
Posts: 4
Hi,

The the batch file I'm using is below:

Code:
@echo off
for /f "tokens=1-4 delims=/ " %% in ('date /T') do set MyDate=%%a%%b%%c
for /f "tokens=1-4 delims=: " %%a in ("%TIME%") do set MyTime=%%a%%b%%c
set LOGFILE=D:\logfilelocation\sfxcl_log_%MyDate%_%MyTime%.txt

sfxcl /NOPROMPT /LOG "%LOGFILE%" D:\path_to_files_for_transfer\rt_*.zip sftp://user:password@hostname//destinationFolder:/
Reply With Quote
  #8  
Old 09-13-2019, 08:01 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,972
Hi clark_c,

I don't think this has anything to do with the scheduled task.

With some slight alterations to your code, it worked for me but as a note, writing/editing batch files is outside the scope of SFXCL support.

Code:
@echo off
for /f "tokens=1-4 delims=/ " %%a in ('date /T') do set MyDate=%%a%%b%%c
for /f "tokens=1-4 delims=: " %%a in ('Time /T') do set MyTime=%%a%%b%%c
set LOGFILE=D:\logfilelocation\sfxcl_log_%MyDate%_%MyTime%.txt
If that does not work, I suggest you verify the Date/Time results on your system and that you are getting what you want (echo each of those variables one at a time).

For me, this resulted in a log named:

sfxcl_log_09132019_0755AM.txt

Which is what I assume you were after.

And you may still have an issue with your SFXCL command-line. Did you see this from the prior post?
Quote:
You might also need to add the /F "Path_to_config" option to point to SecureFX's config.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by bgagnon; 09-13-2019 at 08:53 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:36 PM.