Restructured to better break up backups and add user control

This commit is contained in:
DarkFeather
2017-11-16 17:51:14 -06:00
parent 0aa26c388d
commit 652d7c4795
12 changed files with 69 additions and 68 deletions

View File

@@ -0,0 +1,4 @@
#!/bin/bash
### Cron ###
crontab -l > "$BACKUPDIR"/$(whoami)-crontab

View File

@@ -0,0 +1,6 @@
#!/bin/bash
### Foundation ###
$BACKUPCMD /srv/foundation/ "$BACKUPDIR"/Foundation &>/dev/null
$BACKUPCMD /usr/local/etc/ "$BACKUPDIR"/usr-local-etc

View File

@@ -0,0 +1,4 @@
#!/bin/bash
### Grimoire ###
sudo -u postgres pg_dumpall > "$BACKUPDIR"/grimoire.sql

View File

@@ -0,0 +1,7 @@
#!/bin/bash
### IRC Server ###
$BACKUPCMD /etc/unrealircd/ "$BACKUPDIR"/unrealircd
$BACKUPCMD /etc/anope/ "$BACKUPDIR"/anope
cp /opt/anope/data/anope.db "$BACKUPDIR"

View File

@@ -0,0 +1,5 @@
#!/bin/bash
### Singularity ###
cp /usr/share/webapps/tt-rss/config.php "$BACKUPDIR"/singularity-config.php
sudo -u postgres pg_dump ttrss > "$BACKUPDIR"/ttrss.psql

View File

@@ -0,0 +1,4 @@
#!/bin/bash
### SSHD ###
mkdir -p "$BACKUPDIR"/ssh
$BACKUPCMD /etc/ssh "$BACKUPDIR"/ssh

View File

@@ -0,0 +1,5 @@
#!/bin/bash
### Lighttpd ###
mkdir -p "$BACKUPDIR"/lighttpd "$BACKUPDIR"/http
$BACKUPCMD /etc/lighttpd/ "$BACKUPDIR"/lighttpd
$BACKUPCMD /srv/http/ "$BACKUPDIR"/http/

View File

@@ -0,0 +1,9 @@
#!/bin/bash
### Wiki ###
mkdir "$BACKUPDIR"/wiki/
for i in `find /usr/share/webapps/ -maxdepth 1 -type d | grep mediawiki`; do
foldername="$(echo "$i" | rev | cut -f 1 -d '/' | rev)"
dbname="$(grep '^\$wgDBname' "$i"/LocalSettings.php | cut -f 2 -d \")"
$BACKUPCMD "${i}"/LocalSettings.php "$BACKUPDIR"/wiki/"$foldername"-localsettings.php
sudo -u postgres pg_dump "$dbname" > "$BACKUPDIR"/wiki/"$dbname".psql
done

View File

@@ -0,0 +1,9 @@
#!/bin/bash
### Yggdrasil -- File list only for space reasons ###
if [ -x /usr/bin/locate ]; then
locate /srv/yggdrasil > "$BACKUPDIR"/yggdrasil-file-list.txt
else
find /srv/yggdrasil/ > "$BACKUPDIR"/yggdrasil_file_list.txt
fi