- 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
推薦閱讀
- Mastering Spark for Data Science
- Dreamweaver 8中文版商業(yè)案例精粹
- 輕松學(xué)Java
- Effective DevOps with AWS
- Security Automation with Ansible 2
- 大數(shù)據(jù)安全與隱私保護(hù)
- Java Web整合開(kāi)發(fā)全程指南
- 變頻器、軟啟動(dòng)器及PLC實(shí)用技術(shù)260問(wèn)
- SAP Business Intelligence Quick Start Guide
- AI的25種可能
- 工業(yè)機(jī)器人集成應(yīng)用
- MongoDB 4 Quick Start Guide
- Java組件設(shè)計(jì)
- 簡(jiǎn)明學(xué)中文版Flash動(dòng)畫(huà)制作
- Effective Business Intelligence with QuickSight