From ced15a1d8c1f0a55af391184bf2c67e3475df210 Mon Sep 17 00:00:00 2001 From: Simon Michnowicz <simon.michnowicz@monash.edu> Date: Wed, 13 Mar 2019 17:52:21 +1100 Subject: [PATCH] added -i keyfile on crontab command Former-commit-id: 69798b3038b4a6b9df2392a4db787666e506a9db --- roles/slurm_sql_bk/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/slurm_sql_bk/tasks/main.yml b/roles/slurm_sql_bk/tasks/main.yml index 4c6e0b7e..c98bcbb1 100644 --- a/roles/slurm_sql_bk/tasks/main.yml +++ b/roles/slurm_sql_bk/tasks/main.yml @@ -46,7 +46,7 @@ minute: 55 become: true become_user: root - - name: Create directory {{ SQL_BK_DATA_DIR }} + - name: Create directory {{ SQL_BK_DATA_DIR }} to store initial mysql dump file: path={{ SQL_BK_DATA_DIR }} state=directory become: true become_user: root @@ -64,4 +64,4 @@ - name: copy backup script to server ec2-user@{{ SQL_BK_DEST_HOST }} local_action: command scp -i ./slm_db_backup ./delete_old_mysql_bk.sh "ec2-user@{{ SQL_BK_DEST_HOST }}:" - name: insert delete cron job entry on remote server - local_action: command ssh ec2-user@{{ SQL_BK_DEST_HOST }} "{ crontab -l ; echo '#delete old slurm backups' ; echo '00 23 * * * /home/ec2-user/backup_mysql_for_slurm.sh' ; } | crontab - " + local_action: command ssh -i ./slm_db_backup ec2-user@{{ SQL_BK_DEST_HOST }} "{ crontab -l ; echo '#delete old slurm backups' ; echo '00 23 * * * /home/ec2-user/backup_mysql_for_slurm.sh' ; } | crontab - " -- GitLab