Copy file on remote FTP server

Advertisement

Jens Kristensen
Joined:
Posts:
2
Location:
Denmark

Copy file on remote FTP server

Hi, I would like to copy all files to a backup folder on the FTP server before I download and delete the files.

I'm using the following command lines to do this.
Option Batch on
Option confirm off
Open sftp://username:password@ftpserver.com
cd /home/orderfiles/DAT/
Lcd M:\iPadOrdre\DAT\
cp /home/orderfiles/DAT/*.csv /home/orderfiles/DAT/Backup/*.csv
But i get this error message:
Operation not supported.
How does the CP command work ?
Perhaps there is a other command to backup files before downloading files?

Reply with quote

Advertisement

Jens Kristensen

I have never used a Shell command - always used .bat/txt files. How should then script be written and how do I execute the shell command?
I have to be able to execute it from i.e. a command prompt - is that possible?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
35,415
Location:
Prague, Czechia

Just prefix your cp command with call command, like in my example above.

Though actually, you will need to remove the operation mask from the destination path, as the shell cp command does not support it. And it is not necessary anyway:
call cp /home/orderfiles/DAT/*.csv /home/orderfiles/DAT/Backup/

Reply with quote

Advertisement

You can post new topics in this forum