Skip to content

Commit

Permalink
stratford updates
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-grace authored May 11, 2023
1 parent beddc74 commit e62d793
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# URY's Server Backups

## `urysteve` (primary filestore)
- `backup_dbs.sh` - run daily, takes SQL dumps of our databses, and rsyncs them to `backup0` and `moyles`
- `backups-hourly.sh` - runs hourly, sends all the `filestore` and `musicstore` snapshots to `backup0` and `moyles`
- `backup_dbs.sh` - run daily, takes SQL dumps of our databses, and rsyncs them to `stratford` and `moyles`
- `backups-hourly.sh` - runs hourly, sends all the `filestore` and `musicstore` snapshots to `stratford` and `moyles`
- `sanoid` runs to snapshot the `filestore` and `musicstore`

## `urybackup0` (on-site backup server)
## RIP
- `sanoid` runs to prune old `filestore`/`musicstore` snapshots, and to snapshot `pool0`
- `rsync-daily.new.sh` runs to backup all the other servers we have, i.e. home directories. these are backed up to `pool0`

## `stratford` (on-site backup server)
- `sanoid` runs to prune old `filestore`/`musicstore` snapshots, and to snapshot `backup/servers`
TODO:
- `rsync-daily.new.sh`
- `backup-alerts.sh`

## `moyles` (offsite backup server)
- `sanoid` runs to prune old `filestore`/`musicstore`/`pool0` snapshots
TODO - add `rsync-daily.new.sh` to get moyles backups to be independent of on site backups, and also change the sanid config as needed (i.e. copy stratford)

**Both `urybackup0` and `moyles` run `backup-alerts.sh` daily to send any important information to us in Slack, such as:**
- missing snapshots
Expand All @@ -22,6 +30,6 @@
- `movempg.sh` transfers recorded footage to the `filestore`, where `urysteve` will also tidy up older recordings (older than 90 days)

## TODO
- mailbox backups
- mailbox backups - other than just the `ury` server backup
- external monitoring of `backup-alerts.sh` script actually running

22 changes: 22 additions & 0 deletions stratford/sanoid.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[backup]
autosnap = no
[backup/servers]
use_template = recursive
recursive = yes
hourly = 0
[filestore]
use_template = production
recursive = yes
autosnap = no
[musicstore]
use_template = production
autosnap = no

[template_production]
frequently = 0
hourly = 24
daily = 30
monthly = 6
yearly = 0
autosnap = yes
autoprune = yes
4 changes: 2 additions & 2 deletions urysteve/backup_dbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ for db in ${PG_DATABASES[@]}; do
(export PGPASSWORD="$PG_PASSWORD" && /usr/bin/pg_dump -U "$PG_USERNAME" -F custom -f "$LOCAL_BACKUP_PATH/$db.sql.dump" "$db")
done

for server in "urybackup0.york.ac.uk" "moyles.ury.york.ac.uk"; do
for server in "stratford.ury.york.ac.uk" "moyles.ury.york.ac.uk"; do
# i hate this
if [[ $server == "moyles.ury.york.ac.uk" ]]; then
remote_path=/pool0/db
else
remote_path=/pool0/backup/db
remote_path=/backup/db
fi

set +e
Expand Down
4 changes: 2 additions & 2 deletions urysteve/backups-hourly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

LOG=/var/log/replication.log

/usr/sbin/syncoid -r --no-sync-snap music root@urybackup0.york.ac.uk:music | tee -a $LOG 2>&1
/usr/sbin/syncoid -r --no-sync-snap music root@stratford.ury.york.ac.uk:musicstore | tee -a $LOG 2>&1
/usr/sbin/syncoid -r --no-sync-snap music [email protected]:pool0/music | tee -a $LOG 2>&1
/usr/sbin/syncoid -r filestore root@urybackup0.york.ac.uk:pool1 | tee -a $LOG 2>&1
/usr/sbin/syncoid -r filestore root@stratford.ury.york.ac.uk:filestore | tee -a $LOG 2>&1
/usr/sbin/syncoid -r filestore [email protected]:pool0/pool1 | tee -a $LOG 2>&1

echo "`date` - replication complete." | tee -a $LOG

0 comments on commit e62d793

Please sign in to comment.