我有一个长期运行的rsync,我想通过以下方式进行跟踪:
- name: starting rsync
shell: rsync -az source dest && touch /tmp/rsync-complete
async: 10800 # that's 3 hours!
poll: 0
- name: waiting for rsync to finish
shell: |
du -hc dest && if [ -f /tmp/rsync-complete ]; then echo "rsync complete"; fi
register: register_rsync_progress
until: "'rsync complete' in register_rsync_progress.stdout"
retries: 360
delay: 30
这项工作有效吗?如何确保每次重试循环时都打印du -hc dest
的输出?