From a1442e534d9d26de7bb85fff6e7c09eef972c515 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 Jan 2024 11:37:46 +0100 Subject: [PATCH] Premier commit ... --- roles/smb-backup/files/backupnxc.sh | 10 ++++++++++ roles/smb-backup/tasks/main.yml | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 roles/smb-backup/files/backupnxc.sh diff --git a/roles/smb-backup/files/backupnxc.sh b/roles/smb-backup/files/backupnxc.sh new file mode 100644 index 0000000..5d59210 --- /dev/null +++ b/roles/smb-backup/files/backupnxc.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# envoie sur s-backup +BACKUP=/home/backup/s-nxc + +# Préparation des dossiers qui vont accueillir les données à sauvegarder (-e lance le répertoire si il existe) +[[ -e "${BACKUP}" ]] || mkdir -p "${BACKUP}" + +# Sauvegarde du fichier nxc.tgz vers la machine s-backup +scp -i ~/.ssh/id_rsa_sbackup root@s-nxc.gsb.adm:/root/nxc/nxc.tgz "${BACKUP}/" diff --git a/roles/smb-backup/tasks/main.yml b/roles/smb-backup/tasks/main.yml index 4e177bd..5a82e42 100644 --- a/roles/smb-backup/tasks/main.yml +++ b/roles/smb-backup/tasks/main.yml @@ -14,6 +14,14 @@ group: root mode: '0755' +- name: copie script backupnxc dans /usr/local/bin + copy: + src: backupnxc.sh + dest: /usr/local/bin + owner: root + group: root + mode: '0755' + - name: crontab backupsmb ( commentee par defaut ) cron: name: backupsmb