Initial Setup of scripts
This commit is contained in:
commit
d348d5f616
6 changed files with 46 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
*
|
||||
!*.sh
|
||||
!scripts/*
|
23
cron.monthly.main-backup.sh
Normal file
23
cron.monthly.main-backup.sh
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Mount the backup partition DEV
|
||||
#+ and execute all *.active scripts in the SCRIPTDIR directory
|
||||
|
||||
MOUNTPOINT="/tmp/backup_partition"
|
||||
DEV="/dev/sda4"
|
||||
|
||||
|
||||
ERR_NOSCRIPT=2
|
||||
|
||||
[ -d $MOUNTPOINT ] || mkdir $MOUNTPOINT
|
||||
|
||||
mount $DEV $MOUNTPOINT
|
||||
|
||||
[ ! -d $SCRIPTDIR ] && exit $ERR_NOSCRIPT
|
||||
|
||||
for s in $SCRIPTDIR/*.active
|
||||
do
|
||||
[ -x $s ] && ./$s
|
||||
done
|
||||
|
||||
umount $DEV
|
5
scripts/backup_etc
Normal file
5
scripts/backup_etc
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
ARCHIVE=/backup/etc/$(hostname -s)_$(date +%F)_etc.tar.gz
|
||||
|
||||
tar -cz -C /etc -f $ARCHIVE .
|
5
scripts/backup_mail
Normal file
5
scripts/backup_mail
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
ARCHIVE=/backup/mail/$(hostname -s)_$(date +%F)_vmail.tar.gz
|
||||
|
||||
tar -cz -C /var/vmail -f $ARCHIVE .
|
5
scripts/backup_mysql
Normal file
5
scripts/backup_mysql
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
ARCHIVE=/backup/mysql/$(hostname -s)_$(date +%F)_mysql.gz
|
||||
|
||||
mysqldump --all-databases | gzip > $ARCHIVE
|
5
scripts/backup_named
Normal file
5
scripts/backup_named
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
ARCHIVE=/backup/named/$(hostname -s)_$(date +%F)_named.tar.gz
|
||||
|
||||
tar -cz -C /var/named -f $ARCHIVE .
|
Loading…
Reference in a new issue