Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Automation filetransfer/backup Batch Script

Looks good.
Ep3demic

Automation filetransfer/backup Batch Script

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:

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:

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.