I need to create an application (or find one application) that copies files from a computer to another, across the internet to create automatic backups. The target computer is a company server to which i have phisical access. The "source" computer(s) (several computers in several clients, that we - company, have also phisical acess).

Solutions like teamviewer, PcAnywhere,... just don't fit because we already use them but they don't allow to create automatic backups.

Does anyone knows how can i copy files across the internet, using VB .NET, from one computer to another?

My thanks in advanced

Dani AI

Generated

the roadblock you hit with FTP is usually NAT on the office router. FTP needs a control channel plus a separate passive data port. If the server does not advertise the public IP and you have not forwarded a fixed passive port range on the router, it will work on LAN but fail over the internet. If you stay with FTP, enable FTPS, set a narrow passive range, publish the external IP on the server, and forward those ports (plus 21) in the router. In IIS this is configured via FTP Firewall Support. FTP Firewall Support in IIS.

A simpler and safer option than FTP is SFTP over SSH. Install the built-in OpenSSH Server on the target Windows box and open/forward TCP 22. Then push backups from client PCs with a small VB.NET job using the SSH.NET library (prefer key-based auth; pin the host key). Get started with OpenSSH for Windows. SSH.NET library.

Imports Renci.SshNet
Imports System.IO

Dim host = "server.example.com"
Dim user = "backupuser"
Dim pwd  = "StrongPassword!"
Using sftp As New SftpClient(host, user, pwd)
    sftp.Connect()
    For Each f In Directory.GetFiles("C:\DataToBackup")
        Using fs = File.OpenRead(f)
            sftp.UploadFile(fs, "/backups/" & Path.GetFileName(f), True)
        End Using
    Next
End Using

Tools-wise, ’s SyncBack suggestion is solid if you prefer off‑the‑shelf. If you want delta copies as hinted with rsync, run rsync over SSH; or, over a VPN/SMB path, schedule robocopy /MIR /Z /R:2 /W:5 for resilient transfers. Robocopy command reference.

Recommended Answers

All 7 Replies

Search in internet for FTP... u may get some idea.. U need to write broker service which will be running in ur server.

Thank for your answer.

We've already tried ftp, but we aren't being able to access the server because of the router. When we try over our network, everything works fine, but when we try over the internet we don't have access. Our technician did not (yet) found a way to overcome this problem, that's why we are trying a solution, other than ftp.

Save the files in DB and read from your .Net app or windows service. U can create copy whatever you want, But will not be fast as FTP... This is my idea.. Experts in forum may give there idea's too... :)

You might want to have a look at SyncBack. It comes in three versions:

SynBack Pro $55
SyncBack SE $35
SyncBack Basic (Free)

The free version supports scheduled backups. You can compare all three versions here

It is highly configurable. You can select many options on backup such as what to do when files exist in the source or destination but not in the other, what to do on differing file dates, etc. The free version should do what you want. It also supports copying via FTP. If you want to go even more basic you can use robocopy (which supports continuous run mode with monitor-for-changes). I'd suggest SyncBack as a first try.

Thank you Reverend Jim, i think that is exactly what we need!!!

Glad to help. I had a boss who was pretty tight with the budget so I had to find ways to do more with less. SyncBack was one of those little gems. Please mark this thread as solved.

have u tried rsync?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.