- 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
推薦閱讀
- 大數據技術基礎
- ETL with Azure Cookbook
- Getting Started with Containerization
- 大數據時代的數據挖掘
- Visual C++編程全能詞典
- 塊數據5.0:數據社會學的理論與方法
- Implementing Splunk 7(Third Edition)
- Implementing AWS:Design,Build,and Manage your Infrastructure
- Docker on Amazon Web Services
- Visual FoxPro程序設計
- C++程序設計基礎(上)
- Web編程基礎
- 玩機器人 學單片機
- Red Hat Enterprise Linux 5.0服務器構建與故障排除
- 大數據時代的調查師