A bash script for backup some configuration files on a distant volume.
Prerequies
You need at least this packages:
# yum install nfs-utils |
You need to edit your /etc/fstab
and add the following line:
nfs-stockage.my.company.org:/backups/aap /mnt/aap-backups nfs defaults 0 0 |
You can add a cron
like this (every monday at 8am):
0 8 * * 1 /root/AAP-scripts/backup-config.sh | mailx -v -s "[AAP] - Backup of $HOSTNAME" -S smtp=mail.my.company.org -S from="[email protected]" [email protected] |
Script Bash
This script mount a distant volume, make a backup of AAP configuration with the with Ansible built-in function and purge old backup older than 120 days.
#!/bin/bash |
Documentation
MAN & Internet