Topic "Automation filetransfer/backup Batch Script"

Author Message
Ep3demic
[View user's profile]

Joined: 2013-04-10
Posts: 4
Hi,

I have made a script that "works", but i need to improve it. And i want you guys to look on it, beacuse my scripting skills are not the best.

We have a Remote FTP server that we want to regulary transfer files from to a local folder. We then want to delete the source files from the remote folder on the FTP server.

Here is the FTP Script:

Code:

option batch continue 
option confirm off
#Connect to Remote Ftp Server, then map the folder paths
open username@fmsftp.server.no
lcd "E:\Agresso\Data Files\agresso\Data Import\EHF"
cd /out
#Move only the remote files to the local directory
synchronize local "E:\Agresso\Data Files\agresso\Data Import\EHF"
#Then delete all .xml files older than 1 day on the FTP Server
rm *.xml<1D
exit


Here is the most simple backup script:

Code:

option batch on
option confirm off
#Connect to server
open username@fmsftp.ftpserver.no
#Simply move the files from the FTP server to a local folder
option transfer binary
cd /
get /out "E:\Agresso\Data Files\agresso\Data Import\EHF backup"
exit


Does these scripts do what i want it too do?
How can i improve them?

Thanks.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Looks good.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License