ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Posh-SSH

    Scheduled Pinned Locked Moved IT Discussion
    4 Posts 3 Posters 353 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      demotelo
      last edited by demotelo

      Hello

      I have the following script, which works correctly, but the source folder is growing exponentially and by having -overwrite, it brings me all the data to SFTP, is it possible to copy incrementally?

      Import-Module posh-ssh
      $ThisSession = New-SFTPSession -ComputerName $SftpIp -Credential $Credential
      Set-SFTPFolder -SessionId ($ThisSession).SessionId -RemotePath $SftpPath -LocalFolder $FilePath -Overwrite
      Get-SFTPSession | % { Remove-SFTPSession -SessionId ($_.SessionId) }

      1 Reply Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller
        last edited by

        I don't believe so because SFTP doesn't handle incremental copies. This is why RSYNC is popular in the UNIX world for exactly this task - because SCP/SFTP don't have a delta protocol built in.

        1 Reply Last reply Reply Quote 0
        • dafyreD
          dafyre
          last edited by

          For the remote system, is it always creating new files? If so, you could set your script to delete files older than so many days and then run the SFTP?

          1 Reply Last reply Reply Quote 1
          • D
            demotelo
            last edited by

            @dafyre said in Posh-SSH:

            For the remote system, is it always creating new files? If so, you could set your script to delete files older than so many days and then run the SFTP?

            Of course, the copy of the content is generated with robocopy incrementally, the whole environment is a Windows, except the SFTP which is a Linux, so in theory I could not make incremental copies to the sftp 😞

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post