Aether/server-backup

51 lines
1.3 KiB
Plaintext
Raw Normal View History

#!/bin/bash
export BACKUPDIR="/usr/local/backup"
## Backup small development ##
rsync -avzl --delete-after /root/bin/ "$BACKUPDIR"/root/bin/
## Backup configuration ##
cp -r /etc/skel "$BACKUPDIR"
cp /etc/bash.bashrc "$BACKUPDIR"/bash.bashrc
cp /etc/vimrc "$BACKUPDIR"/vimrc
## Backup the good servers ##
### SSHD ###
rsync -avzl --delete-after /etc/ssh "$BACKUPDIR"/ssh
### Lighttpd ###
rsync -avzl --delete-after /etc/lighttpd/ "$BACKUPDIR"/lighttpd
rsync -avzl --delete-after /srv/http/ "$BACKUPDIR"/http/
### Cron ###
crontab -l > "$BACKUPDIR"/$(whoami)-crontab
### IRC Server ###
rsync -avzl --delete-after /etc/unrealircd/ "$BACKUPDIR"/unrealircd
rsync -avzl --delete-after /etc/anope/ "$BACKUPDIR"/anope
# TODO add backup
### TheRaven ###
# Added under Bazaar source
### Bazaar ###
rsync -avzl --delete-after /srv/bazaar/ "$BACKUPDIR"/bazaar
rsync -avzl --delete-after /usr/local/src/ "$BACKUPDIR"/src
rsync -avzl --delete-after /usr/local/etc/ "$BACKUPDIR"/usr-local-etc
### Wiki ###
rsync -avzl --delete-after /usr/share/webapps/mediawiki/LocalSettings.php "$BACKUPDIR"/mediawiki-localsettings.php
### Singularity ###
# Backed up by postgres backup
### PostgreSQL ###
# TODO
# TODO evaluate for other services not covered.
date > /var/log/server-backup.log