Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sync Folders to S3 - C# Library

Tags:

.net

amazon-s3

Is there a .NET library that I can use to sync a folder to S3? I am not interested in full apps or command line tools, just the API. I need to use it from my own app directly.

If there isn't, has anyone written their own, and if so, can you share some of the key considerations when writing one? Anything specific I need to watch out for?

By the way, I will be using this for backups so that I don't have to zip an entire folder and upload the zip file to S3 each time. I am hoping that doing it this way will take a shorter time for very large folders (something like SyncBack).

like image 560
stepanian Avatar asked Nov 05 '22 20:11

stepanian


1 Answers

You can periodically simply loop through file list and use these libraries to call API http://weblogs.asp.net/israelio/archive/2004/06/23/162913.aspx OR Try http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx ? You can simply watch OnDeleted , OnCreated and OnChanged events . And call S3 API accordingly.

You can even a temporary zip it and than put it on S3 as suggested here. How do I create 7-Zip archives with .NET? . And delete once its uploaded on S3.

like image 55
Pit Digger Avatar answered Nov 15 '22 04:11

Pit Digger