Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化etcd备份文件名称,加时间 #902

Merged
merged 1 commit into from
Sep 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion 23.backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@

- debug: var="RUNNING_NODE.stdout"

- name: get current time
set_fact: temp="{{lookup('pipe','date \"+%Y%m%d_%H%M\"')}}"

# step2: backup data on the healthy member
- name: make a backup on etcd node
shell: "mkdir -p /etcd_backup && cd /etcd_backup && \
ETCDCTL_API=3 {{ bin_dir }}/etcdctl snapshot save snapshot.db"
ETCDCTL_API=3 {{ bin_dir }}/etcdctl snapshot save snapshot_{{ temp }}.db"
args:
warn: false
delegate_to: "{{ RUNNING_NODE.stdout }}"
Expand Down