diff --git a/deploy/ansible.yml b/deploy/ansible.yml index 611abdb..eec188b 100644 --- a/deploy/ansible.yml +++ b/deploy/ansible.yml @@ -2,6 +2,13 @@ - hosts: "{{ deploy_hosts }}" remote_user: ubuntu tasks: + - name: copy shell + copy: + src: ../deploy/cleanup.sh + dest: "{{ deploy_dir }}/cleanup.sh" + owner: ubuntu + group: ubuntu + mode: 0777 - name: copy execute file to dest copy: src: ../jx-print diff --git a/deploy/cleanup.sh b/deploy/cleanup.sh new file mode 100644 index 0000000..5fe8ef9 --- /dev/null +++ b/deploy/cleanup.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if [ ! -d "backup" ]; then + mkdir backup +fi + +if ls jx-print.*~ > /dev/null 2>&1; then + mv jx-print.*~ backup/ +fi \ No newline at end of file