C # Copy directory to another server

After numus failed to try to use robocopy to mirror accoss files on another server as an SQL job (Dont ask).

The task should run every 15 minutes and run as an SQL job to copy all transaction logs and backup files, and therefore this job does not work when it is sent to SQL, which is then checked by MOM. The task cannot simply copy the entire directory every time, since its size of about 50 GB should simply reflect directroy, in other words, get rid of files that do not exist in the source directory and copy new files.

It has been suggested that C # is the best way (and its a good learning curve for me). But my C # knowlege is very minimal.

Sorry, I want to say that we are on a limited network, and Robocopy is the only option that can be used for search. FTP is also prohibited.

reference

thank

+3
source share
6 answers

If I understand you well, you need to copy the directory to a server, however, since the directory is 50 GB in size, you only need to move certain files.

If so, then I suggest you take a look at FileSystemWatcher . It basically “listens” for any changes made to files in a given directory, and you can use these actions to find out which action was performed (created, edited, deleted) in which file.

+2
source

Microsoft TyncToy , . GUI,

+1

# - , - rsync. Windows, Linux, . /, . Windows cygwin, API.

+1

, , , Robocopy - , . FTP .

0

SyncToy Microsoft , . , (/). , . , , " ".

EDIT:

If the SyncToy user interface is not your thing, you can use the underlying infrastructure (Microsoft Sync Framework) http://msdn.microsoft.com/en-us/sync/bb887623.aspx to develop your own UIs or just use it in the background.

0
source

Source: https://habr.com/ru/post/1759491/


All Articles