- Security Automation with Ansible 2
- Madhu Akula Akash Mahajan
- 172字
- 2021-07-02 22:00:00
Setting up automated encrypted backups in AWS S3
Backups are always something that most of us feel should be done, but they seem quite a chore. Over the years, people have done extensive work to ensure we can have simple enough ways to back up and restore our data.
In today's day and age, a great backup solution/software should be able to do the following:

The following code snippet is to set up duply for encrypted automated backups from the server to AWS S3:
- name: installing duply
apt:
name: "{{ item }}"
update_cache: yes
state: present
with_items:
- python-boto
- duply
- name: check if we already have backup directory
stat:
path: "/root/.duply/{{ new_backup_name }}"
register: duply_dir_stats
- name: create backup directories
shell: duply {{ new_backup_name }} create
when: duply_dir_stats.stat.exists == False
- name: update the duply configuration
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- { src: conf.j2, dest: /root/.duply/{{ new_backup_name }}/conf }
- { src: exclude.j2, dest: /root/.duply/{{ new_backup_name }}/exclude }
- name: create cron job for automated backups
template:
src: duply-backup.j2
dest: /etc/cron.hourly/duply-backup
推薦閱讀
- 人工智能超越人類
- 人工免疫算法改進(jìn)及其應(yīng)用
- Getting Started with Clickteam Fusion
- UTM(統(tǒng)一威脅管理)技術(shù)概論
- 機(jī)艙監(jiān)測(cè)與主機(jī)遙控
- 深度學(xué)習(xí)中的圖像分類與對(duì)抗技術(shù)
- Machine Learning with the Elastic Stack
- Cloud Security Automation
- 自動(dòng)化生產(chǎn)線安裝與調(diào)試(三菱FX系列)(第二版)
- 自適應(yīng)學(xué)習(xí):人工智能時(shí)代的教育革命
- 商務(wù)智能
- Adobe Edge Quickstart Guide
- Kibana 7 Quick Start Guide
- 巧學(xué)活用WPS
- 信息技術(shù)基礎(chǔ)應(yīng)用