Announcement

Collapse
No announcement yet.

WinScp Automate

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • WinScp Automate

    Hi All

    Im looking for an example fo how automate the copying of files from a linux system to a windows share.

    I know I can use the WinScp Gui to transfer the files manually.

    I would like to copy over e.g. log files from the linux server to the windows box automatically.

    Im thinking batch file for winscp that is launched from the windows box via the task scheduler.

    Anyone have any advice or command examples?

    Thanks for reading

    Confuseis

  • #2
    Re: WinScp Automate

    Is SMB enabled on the Linux box? If so then you can just share out the appropriate folder and copy the files from Windows using built-in tools like robocopy.

    http://www.linux.com/learn/tutorials...ty-samba-setup
    Regards,
    Jeremy

    Network Consultant/Engineer
    Baltimore - Washington area and beyond
    www.gma-cpa.com

    Comment


    • #3
      Re: WinScp Automate

      Should have mentioned

      Its smoothwall firewall/gateway so no samba

      Comment


      • #4
        Re: WinScp Automate

        Ah, sorry, not familiar with that so I probably won't be much help.
        Regards,
        Jeremy

        Network Consultant/Engineer
        Baltimore - Washington area and beyond
        www.gma-cpa.com

        Comment


        • #5
          Re: WinScp Automate

          Will be copying the file using sftp/ssh thats why using winscp.

          Comment


          • #6
            Re: WinScp Automate

            I use Winscp in exactly this way to backup one of my servers.

            You need to create text file with the Winscp commands then run it from the batch file.

            For example, remotecopy.script:

            Code:
            option batch abort
            option confirm off
            open sftp://username:[email protected]
            put filename
            close
            exit
            Then the batch file would look like this, run_script.bat:

            Code:
            winscp /script=remotecopy.script
            More details here:
            winscp.net/eng/docs/scripting

            Comment


            • #7
              Re: WinScp Automate

              That worked beautifully

              My tweaks needed are in bold

              Many thanks

              option batch abor
              t option confirm off
              open sftp://username[email protected]:portnumber
              get filename
              close
              exit

              Comment

              Working...
              X