Rename a file using command line in Core FTP Lite
Rename a file using command line in Core FTP Lite
I need to sFTP a file with .tmp extension using command line and once the transfer is complete, rename the file to a different extension. Seems like -FN can't be used to rename an existing file. Is there any other way to rename a file?
I wanted to avoid the GUI and put everything in a script file, so that setting up the app on other machines is as easy as just copying the script file. Does CoreFTP (LE or PRO) have a command line option to RENAME a file using sFTP?
I am looking for equivalent for FTP rename command:
rename FileName NewFileName
corecmd.exe -ssh -s -u "D:\sFTPTest\HMISP.D.FIL.CUC.B93Y.MAR2807.pgp" "sftp://userid:password@xxx.yyy.com/home/userid/to_xxx/" -FN "test.file.tmp" -log "D:\sFTPTest\log.txt" -output "D:\sFTPTest\output.txt"
Looks like FN only renames the file when you are uploading and you can't use it once the file has been uploaded.
I am looking for equivalent for FTP rename command:
rename FileName NewFileName
corecmd.exe -ssh -s -u "D:\sFTPTest\HMISP.D.FIL.CUC.B93Y.MAR2807.pgp" "sftp://userid:password@xxx.yyy.com/home/userid/to_xxx/" -FN "test.file.tmp" -log "D:\sFTPTest\log.txt" -output "D:\sFTPTest\output.txt"
Looks like FN only renames the file when you are uploading and you can't use it once the file has been uploaded.
Following on from RB's request i am planning on using the scripting to perform a rename on the host files using RNFR and RNTO but want to include a extra file extension of '.lck' i.e
RNFR /from_client/%1
RNTO /from_client/%1 + ".LCK"
please can you help me with the correct syntax, how do i append an additonal string to the rename function?
RNFR /from_client/%1
RNTO /from_client/%1 + ".LCK"
please can you help me with the correct syntax, how do i append an additonal string to the rename function?
we want to upload file abc.inp, then rename to abc.txt
use post-transfer-command
RNFR /original_sourcepath/%1
RNTO /processed/%1.txt
the file name we get is abc.inp.txt, is there any means to meet our needs?
The reason for the rename is the SFTP server side has a monitor,which will grab any .txt file, if we upload a .txt file directly, the monitor could pick a unfinished file. so it's a must to upload .inp then rename to .txt.
use post-transfer-command
RNFR /original_sourcepath/%1
RNTO /processed/%1.txt
the file name we get is abc.inp.txt, is there any means to meet our needs?
The reason for the rename is the SFTP server side has a monitor,which will grab any .txt file, if we upload a .txt file directly, the monitor could pick a unfinished file. so it's a must to upload .inp then rename to .txt.