Click here to Skip to main content
15,881,172 members
Articles / Programming Languages / C#

Amazon S3 Sync

Rate me:
Please Sign up or sign in to vote.
4.92/5 (6 votes)
1 Dec 2010Apache5 min read 47.8K   1.6K   23  
Synchronize files from your computer to Amazon S3.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>

    <add key="LogOnlyMode" value="true" />
    <add key="LogLevel" value="1" />
    <add key="LogFilePath" value="" />
    <add key="OverwriteExistingLogFile" value="true" />

    <add key="AWSAccessKeyId" value="" />
    <add key="AWSSecretAccessKey" value="" />
    <add key="UseSSL" value="true" />
    <add key="RequestEndpoint" value="s3.amazonaws.com" />
    <add key="BucketName" value="" />
    <add key="UploadPrefix" value="" />
    <add key="UploadHeaders" value="" />
    <add key="OverrideContentTypes" value="" />
    <add key="CalculateMD5ForUpload" value="true" />
    <add key="SaveTimestampsInMetadata" value="true" />
    <add key="UploadSpeedLimitKBps" value="0" />
    <add key="ShowUploadProgress" value="true" />
    <add key="S3ErrorRetries" value="0" />

    <add key="SoureFolder" value="" />
    <add key="IncludeSubFolders" value="true" />
    <add key="ExcludeFolders" value="" />
    <add key="IncludeOnlyFilesRegularExpression" value="" />
    <add key="ExcludeFilesRegularExpression" value="" />

    <add key="CompareFilesBy" value="ETag" />
    <add key="DeleteS3ItemsWhereNotInLocalList" value="true" />

    <add key="EmailLogCondition" value="0" />
    <add key="EmailSmtpHost" value=""/>
    <add key="EmailSmtpPort" value=""/>
    <add key="EmailSmtpEnableSsl" value="true"/>
    <add key="EmailSmtpUserName" value=""/>
    <add key="EmailSmtpPassword" value=""/>
    <add key="EmailFromAddress" value=""/>
    <add key="EmailRecipients" value=""/>


    <!--  The following are examples of App.config values.  The following code is commented and changing the values will have no affect.  Change the values above to specify your settings.

    <add key="LogOnlyMode" value="false" />
    <add key="LogLevel" value="1" />
    <add key="LogFilePath" value="C:\SyncFromLocalToS3Log.txt" />
    <add key="OverwriteExistingLogFile" value="true" />

    <add key="AWSAccessKeyId" value="myaccesskey" />
    <add key="AWSSecretAccessKey" value="mysecretkey" />
    <add key="UseSSL" value="true" />
    <add key="RequestEndpoint" value="s3.amazonaws.com" />
    <add key="BucketName" value="mybucket" />
    <add key="UploadPrefix" value="myS3folder/" />
    <add key="UploadHeaders" value="x-amz-acl:public-read|x-amz-storage-class:REDUCED_REDUNDANCY" />
    <add key="OverrideContentTypes" value=".zip:application/x-zip-compressed|.aspx:text/plain" />
    <add key="CalculateMD5ForUpload" value="true" />
    <add key="SaveTimestampsInMetadata" value="true" />
    <add key="UploadSpeedLimitKBps" value="30" />
    <add key="ShowUploadProgress" value="true" />
    <add key="S3ErrorRetries" value="0" />

    <add key="SoureFolder" value="C:\MySync" />
    <add key="IncludeSubFolders" value="true" />
    <add key="ExcludeFolders" value="C:\MySync\DoNotSyncA|C:\MySync\DoNotSyncB" />
    <add key="IncludeOnlyFilesRegularExpression" value=".*\.txt$" />
    <add key="ExcludeFilesRegularExpression" value=".*\.(jpg|gif|jpeg)$" />

    <add key="CompareFilesBy" value="ETag" />
    <add key="DeleteS3ItemsWhereNotInLocalList" value="true" />

    <add key="EmailLogCondition" value="1" />
    <add key="EmailSmtpHost" value="smtp.gmail.com"/>
    <add key="EmailSmtpPort" value="587"/>
    <add key="EmailSmtpEnableSsl" value="true"/>
    <add key="EmailSmtpUserName" value="user@gmail.com"/>
    <add key="EmailSmtpPassword" value="gmailpassword"/>
    <add key="EmailFromAddress" value="user@gmail.com"/>
    <add key="EmailRecipients" value="person1@company.com;person2@company.com"/>
    -->
    
  </appSettings>
</configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


Written By
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions