summaryrefslogtreecommitdiff
path: root/archive/bin/weekly-backups
blob: 9e71b9f797f50b1790656af9dd5fecf28ddcf3f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh

# the idea is that if this script dies it can be safely be re-run from the beginning

. "$HOME/.shenv"
. "$HOME/lib/try.sh"
. "$HOME/lib/tputfs.sh"

if ! mount | grep -q bkupsd && ! mount | grep -q m3; then
    echo >&2 "$(basename $0): plug in and mount a cold backup drive"
    exit 1
fi

cd "$HOME"

zero ls "$HOME/tmp"
zero ls /tmp/debuild
zero ssh athena ls tmp
mount "$HOME/lib/fm" || true
zero ls "$HOME/lib/fm/tmp"

# TODO: write a file to ~/.cache and if that file was edited today, skip these
ssh athena df -h
ssh athena uptime
status Press enter to confirm that athena has enough free disc space
status and it has not been unexpectedly rebooted recently \(see RepeatedTasks.org\)
status Or hit C-c and deal with the situation
read _

try ssh -t athena "sudo apt-get update && sudo apt-get upgrade"

status running src-unregistered check
status unregistered repos need to have 'mr register' run in them
status "(and tracking branches set up, and new alioth repos added to coldbkup script)"
status periodically remove old projects from ~/src
zero src-unregistered

# status "running restow operation: failures indicate symlinks replaced by updated files"
# status "move these into the relevant stow'd repository"
zero mr -ms misstowed --delete-unmodified # use 'mr adopt' on the result
try mr -ms restow

try mr -ms autoci
# `mr -ms isclean` checks for stuff to be checked in ...
try mr -ms isclean
try mr -s up
try mr -s push origin --tags :
# ... then `mr -ms status` finds unpushed branches
zero mr -ms status
try coldbkup

try sudo apt-get update
try sudo apt-get upgrade
try sudo apt-get dist-upgrade
try sudo apt-get autoremove
try git-pbuilder update --override-config

zero check-mailqs