mirror of
https://github.com/ThunixdotNet/ansible.git
synced 2026-01-24 21:40:17 +00:00
Adding backup script to ansible, and exempting nobackup
This commit is contained in:
8
roles/shell/files/usr/local/bin/backup
Executable file
8
roles/shell/files/usr/local/bin/backup
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
tar -cvz --exclude "nobackup" --exclude='/home/chuck/*' --exclude='/home/slip/*' --exclude='/home/angelok/*' --exclude='/home/usernameak/*' --exclude='/home/ubergeek/*' --exclude='/home/amcclure/*' --exclude='/home/fosslinux/*' --exclude='/home/zszoke/*' -f /var/backups/`date +%Y%m%d`.tgz /home/
|
||||
|
||||
chown root:sudo /var/backups/$(date +%Y%m%d).tgz
|
||||
chmod 640 /var/backups/*.tgz
|
||||
|
||||
find /var/backups -name "*.tgz" -mtime +3 -exec rm {} \;
|
||||
Reference in New Issue
Block a user