windows - ftp batch file script -


hoping can guide me / me.

the issue, have 2 servers 1 running ubuntu has website clients login , download / view reports. other windows server 2012 r2 creates / stores reports. need move files windows ubuntu server clients can view. data large 7gb , growing @ 3 gb year.

i need batch file connect using ftp , copy folder local folder. needs copy files have modified.

i have ever written 1 batch file , cant seem find ftp batch scripts copies modifed files.

your last resort cant seem find coder knows batch script (its dieing art). have never used powershell not know start here.

any or advice please let me know.

thanks john

you can powershell winscp. exemple :

try { # load winscp .net assembly add-type -path "winscpnet.dll"  # setup session options $sessionoptions = new-object winscp.sessionoptions -property @{     protocol = [winscp.protocol]::sftp     hostname = "example.com"     username = "user"     password = "mypassword"     sshhostkeyfingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" }  $session = new-object winscp.session  try {     # connect     $session.open($sessionoptions)      # upload files     $transferoptions = new-object winscp.transferoptions     $transferoptions.transfermode = [winscp.transfermode]::binary      $transferresult = $session.putfiles("d:\toupload\*", "/home/user/", $false, $transferoptions)      # throw on error     $transferresult.check()      # print results     foreach ($transfer in $transferresult.transfers)     {         write-host ("upload of {0} succeeded" -f $transfer.filename)     } } {     # disconnect, clean     $session.dispose() }       exit 0 } catch [exception] {     write-host ("error: {0}" -f $_.exception.message)     exit 1 } 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -