tags:

views:

82

answers:

6

After numerus failed attempts of trying to use robocopy to mirror files accoss to another server as a SQL job(Dont ask).

The job would have to run every 15 minutes and run as a SQL job to copy all transaction logs and backup files and so that is the job fails it reports up in SQL which is then checked by MOM. The job can not just copy the whole directory every time as its about 50gb in size it would just have to mirror the directroy, In other words get rid of the files that dont exist on the source directory and copy the new files that do.

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 fogot to mention we are on a restricted network and Robocopy was the only option ragerding applications. FTP is alsoo banned.

Help

Thanks

A: 

It sounds like using FTP to transfer the files would be a good option.

Here's a tutorial on uploading a file with FtpWebRequest using C#: http://www.vcskicks.com/csharp_ftp_upload.php

Nathan Taylor
I don't think FTP is the best option to copy a directory of 50GB. And if he don't want to copy the file every time he will need to write the synchronisation logic by himself
Wouter Janssens - Xelos bvba
He asked for a C# solution, that was what came to mind. Can you think of a better option using C#? I don't know if C# is necessarily the best solution, but I feel I answered his question at least.
Nathan Taylor
+1  A: 

You can write a program by yourself or install a tool from Microsoft TyncToy this tool allows you to create folder-pairs that needs to be synchronized. The first time set up the folder-pairs using the GUI but afterwords you can call the tool from command line

Wouter Janssens - Xelos bvba
+2  A: 

If I understand you well, you need to copy a directory over to some server, however, since the directory is 50Gb in size, you need only to move specific files.

If that is the case, then I suggest you take a look at the FileSystemWatcher. It basically "listens" to any changes made to files in a given directory, and you can use those actions to know what action was done (created, edited, deleted) on what file.

npinti
+1  A: 

As a non-C# option - I'm not sure really why that would help - there's also rsync. I haven't used it on Windows but I've used it on Linux to do this sort of thing. It can run as daemon / client to split the work between the machines. However it only appears to be available on Windows through cygwin, not with the native APIs.

Rup
A: 

Sorry I fogot to mention we are on a restricted network and Robocopy was the only option ragerding applications. FTP is alsoo banned.

andy
You should either add that as a comment below your question or edit it into the question - it's easier to find up there! Thanks.
Rup
... but it's OK to write your own application in C#?
Rup
Edit to first post done, Yes i am trusted :)
andy
A: 

For a non-programming type option, SyncToy from Microsoft works well to keep file directories in sync. There are different folder options on how to handle changes (updates/deletes). I use this in combination with the Task Scheduler to run at predetermined times during the day. In addition, I also keep a shortcut on my desktop so I can run it 'out of schedule' when necessary.

EDIT:

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

Edward Leno