GithubHelp home page GithubHelp logo

isabella232 / infra-role-s3cmd-sync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from status-im/infra-role-s3cmd-sync

0.0 0.0 0.0 7 KB

Ansible role for syncing folders with S3 buckets

License: MIT License

infra-role-s3cmd-sync's Introduction

Description

This role is intended for syncing folders with S3 buckets.

Installation

In your requirements.yml file:

- name: infra-role-s3cmd-sync
  src: [email protected]:status-im/infra-role-s3cmd-sync.git
  scm: git

Usage

Should be included by another role and ran with necessary variables:

- name: Configure Ghost backups
  include_role:
    name: infra-role-s3cmd-sync
  vars:
    s3cmd_sync_name: 'my-app-logs'
    s3cmd_sync_bucket_name: 'logs-backup'
    s3cmd_sync_bucket_path: '/subdir/'
    s3cmd_sync_directory: '/var/log/my-app'
    s3cmd_sync_timer_frequency: 'daily'
    s3cmd_sync_include_regexes: ['.*\.gz$']
    s3cmd_sync_exclude_regexes: ['.*\.log$']
    s3cmd_sync_access_key: 'ACCESS_KEY'
    s3cmd_sync_secret_key: 'SECRET_KEY'

Administration

You can manage the Systemd service and timer using systemctl:

 > sudo systemctl status -cat sync-my-app-logs.service
● sync-my-app-logs.service - Sync /data/my-app/logs/. to s3://logs-backup/
     Loaded: loaded (/etc/systemd/system/sync-my-app-logs.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Thu 2022-01-27 18:53:09 UTC; 57s ago
TriggeredBy: ● sync-my-app-logs.timer
       Docs: https://github.com/status-im/infra-role-systemd-timer
    Process: 230052 ExecStart=/usr/bin/s3cmd sync --stats /data/my-app/logs/. s3://logs-backup/subdir/ (code=exited, status=0/SUCCES>
   Main PID: 230052 (code=exited, status=0/SUCCESS)

Starting Sync /data/my-app/logs/. to s3://logs-backup/...
upload: '/data/my_app/logs/./20220127_1800.log.gz' -> 's3://logs-backup/subdir/20220127_1800.log.gz' (3670016 bytes in 0.3 seconds, 10.97 MB/s) [1 of 1]
Done. Uploaded 3670016 bytes in 1.0 seconds, 3.50 MB/s.
Stats: Number of files: 29 (327578277 bytes)
Stats: Number of files transferred: 1 (3670016 bytes)
sync-my_app-logs.service: Succeeded.
Finished Sync /data/my-app/logs/. to s3://logs-backup/.

infra-role-s3cmd-sync's People

Contributors

jakubgs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.