Skip to content

Instantly share code, notes, and snippets.

@oleynikd
Last active June 25, 2018 16:43
Show Gist options
  • Select an option

  • Save oleynikd/0a2cf2952ed32bf1f899 to your computer and use it in GitHub Desktop.

Select an option

Save oleynikd/0a2cf2952ed32bf1f899 to your computer and use it in GitHub Desktop.

Revisions

  1. oleynikd revised this gist Jan 10, 2015. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions duply.md
    Original file line number Diff line number Diff line change
    @@ -77,6 +77,11 @@ Directory to backup:
    SOURCE='/var/www/'
    ```

    Set backup's max age (Used for the "purge" command.):
    ```
    MAX_AGE=6M
    ```

    Save and exit!

    ## Run
  2. oleynikd revised this gist Jan 10, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions duply.md
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,7 @@ cd ~
    wget http://downloads.sourceforge.net/project/ftplicity/duply%20%28simple%20duplicity%29/1.9.x/duply_1.9.1.tgz
    tar -zxvf ./duply_1.9.1.tgz
    sudo cp ./duply_1.9.1/duply /usr/bin/
    rm -r ./duply_1.9.1
    ```

    Install [boto](https://github.com/boto/boto) for S3 support:
  3. oleynikd revised this gist Jan 10, 2015. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion duply.md
    Original file line number Diff line number Diff line change
    @@ -93,4 +93,11 @@ And add (newline at the end is requiered):
    # Daily Backups @ 5 am
    0 5 * * * duply www backup
    ```
    ```

    To be quiet:
    ```
    # Daily Backups @ 5 am (quiet)
    0 5 * * * duply www backup > /dev/null 2>&1
    ```
  4. oleynikd revised this gist Jan 10, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion duply.md
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,9 @@ GPG_PW='MYSUPERPASSWORD'

    Set S3 bucket as a backup target:
    ```
    TARGET='s3://s3-eu-west-1.amazonaws.com/mybucket/some/sub/folder/'
    TARGET='s3://s3-region.amazonaws.com/mybucket/some/sub/folder/'
    #ex.:
    TARGET='s3://s3-eu-west-1.amazonaws.com/mybackups/www/'
    ```

    S3 Access Key ID gose here:
    @@ -74,6 +76,8 @@ Directory to backup:
    SOURCE='/var/www/'
    ```

    Save and exit!

    ## Run
    Run backup:
    ```
  5. oleynikd revised this gist Jan 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion duply.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ tar -zxvf ./duply_1.9.1.tgz
    sudo cp ./duply_1.9.1/duply /usr/bin/
    ```

    Install boto for S3 support:
    Install [boto](https://github.com/boto/boto) for S3 support:
    ```
    sudo pip install boto
    ```
  6. oleynikd revised this gist Jan 10, 2015. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions duply.md
    Original file line number Diff line number Diff line change
    @@ -72,4 +72,21 @@ TARGET_PASS='aAezgEBvz6i34df0AHRTagNTS3wMT4w5np55eEDD'
    Directory to backup:
    ```
    SOURCE='/var/www/'
    ```

    ## Run
    Run backup:
    ```
    duply www backup
    ```

    ## Cron config
    ```
    crontab -e
    ```
    And add (newline at the end is requiered):
    ```
    # Daily Backups @ 5 am
    0 5 * * * duply www backup
    ```
  7. oleynikd revised this gist Jan 10, 2015. 1 changed file with 21 additions and 8 deletions.
    29 changes: 21 additions & 8 deletions duply.md
    Original file line number Diff line number Diff line change
    @@ -38,25 +38,38 @@ To create backup profile (ex. www) use
    duply www create
    ```

    Now edit default configuration (/home/ec2-user/.duply/www/conf)
    Edit default configuration (/home/ec2-user/.duply/www/conf)
    ```
    vi /home/ec2-user/.duply/www/conf
    ```

    conf file is pretty well documented, read it!
    conf file is pretty well documented, **read it!**

    To use simple password protection comment line:
    `#GPG_KEY='_KEY_ID_'`
    ```
    #GPG_KEY='_KEY_ID_'
    ```
    And enter your password here:
    `GPG_PW='MYSUPERPASSWORD'`
    ```
    GPG_PW='MYSUPERPASSWORD'
    ```

    Set S3 bucket as a backup target:
    `TARGET='s3://s3-eu-west-1.amazonaws.com/mybucket/some/sub/folder/'`
    ```
    TARGET='s3://s3-eu-west-1.amazonaws.com/mybucket/some/sub/folder/'
    ```

    S3 Access Key ID gose here:
    `TARGET_USER='FEGAIKGR4OLIFF2UIP34'`
    ```
    TARGET_USER='FEGAIKGR4OLIFF2UIP34'
    ```

    S3 Secret Access Key gose here:
    `TARGET_PASS='aAezgEBvz6i34df0AHRTagNTS3wMT4w5np55eEDD'`
    ```
    TARGET_PASS='aAezgEBvz6i34df0AHRTagNTS3wMT4w5np55eEDD'
    ```

    Directory to backup:
    `SOURCE='/var/www/'`
    ```
    SOURCE='/var/www/'
    ```
  8. oleynikd revised this gist Jan 10, 2015. 1 changed file with 23 additions and 6 deletions.
    29 changes: 23 additions & 6 deletions duply.md
    Original file line number Diff line number Diff line change
    @@ -2,29 +2,29 @@
    Installing using [yum](http://yum.baseurl.org).
    By default Amazon Linux AMI release has only AWS's yum repos, but it has EPEL (Extra Packages for Enterprise Linux) predefined but not enabled. To temporarily enable the EPEL 6 repository, use the yum command line option **--enablerepo=epel**.

    Run
    Installing duplicity and dependencies:
    ```
    sudo yum install duplicity rsync gpg python python-devel python-pip --enablerepo=epel
    ```

    Insalling duply manually (latest version can be found [here](http://duply.net/wiki/index.php/Duply-downloads))
    Insalling duply manually (latest version can be found [here](http://duply.net/wiki/index.php/Duply-downloads)):
    ```
    cd ~
    wget http://downloads.sourceforge.net/project/ftplicity/duply%20%28simple%20duplicity%29/1.9.x/duply_1.9.1.tgz
    tar -zxvf ./duply_1.9.1.tgz
    sudo cp ./duply_1.9.1/duply /usr/bin/
    ```

    Install boto for S3 support
    Install boto for S3 support:
    ```
    sudo pip install boto
    ```

    Test duply
    Test duply:
    ```
    duply -v
    ```
    This command should output something like
    This command should output something like:
    ```
    duply version 1.9.1
    (http://duply.net)
    @@ -40,6 +40,23 @@ duply www create

    Now edit default configuration (/home/ec2-user/.duply/www/conf)
    ```
    vi /home/ec2-user/.duply/test/conf
    vi /home/ec2-user/.duply/www/conf
    ```

    conf file is pretty well documented, read it!
    To use simple password protection comment line:
    `#GPG_KEY='_KEY_ID_'`
    And enter your password here:
    `GPG_PW='MYSUPERPASSWORD'`

    Set S3 bucket as a backup target:
    `TARGET='s3://s3-eu-west-1.amazonaws.com/mybucket/some/sub/folder/'`

    S3 Access Key ID gose here:
    `TARGET_USER='FEGAIKGR4OLIFF2UIP34'`

    S3 Secret Access Key gose here:
    `TARGET_PASS='aAezgEBvz6i34df0AHRTagNTS3wMT4w5np55eEDD'`

    Directory to backup:
    `SOURCE='/var/www/'`
  9. oleynikd renamed this gist Jan 10, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  10. oleynikd created this gist Jan 10, 2015.
    45 changes: 45 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    ### Installing on [Amazon Linux AMI](http://aws.amazon.com/amazon-linux-ami/) (release 2014.09)
    Installing using [yum](http://yum.baseurl.org).
    By default Amazon Linux AMI release has only AWS's yum repos, but it has EPEL (Extra Packages for Enterprise Linux) predefined but not enabled. To temporarily enable the EPEL 6 repository, use the yum command line option **--enablerepo=epel**.

    Run
    ```
    sudo yum install duplicity rsync gpg python python-devel python-pip --enablerepo=epel
    ```

    Insalling duply manually (latest version can be found [here](http://duply.net/wiki/index.php/Duply-downloads))
    ```
    cd ~
    wget http://downloads.sourceforge.net/project/ftplicity/duply%20%28simple%20duplicity%29/1.9.x/duply_1.9.1.tgz
    tar -zxvf ./duply_1.9.1.tgz
    sudo cp ./duply_1.9.1/duply /usr/bin/
    ```

    Install boto for S3 support
    ```
    sudo pip install boto
    ```

    Test duply
    ```
    duply -v
    ```
    This command should output something like
    ```
    duply version 1.9.1
    (http://duply.net)

    Using installed duplicity version 0.6.22, python 2.6.9, gpg 2.0.25 (Home: ~/.gnupg), awk 'GNU Awk 3.1.7', bash '4.1.2(1)-release (x86_64-redhat-linux-gnu)'.
    ```

    ### Configuring
    To create backup profile (ex. www) use
    ```
    duply www create
    ```

    Now edit default configuration (/home/ec2-user/.duply/www/conf)
    ```
    vi /home/ec2-user/.duply/test/conf
    ```