1 |
14392
|
aaronmk
|
#!/bin/bash -e
|
2 |
|
|
# usage: . self
|
3 |
|
|
set -o errexit -o pipefail # errexit since may be called from shell
|
4 |
14391
|
aaronmk
|
|
5 |
14392
|
aaronmk
|
if test "$1" = .; then set --; fi # was .-included without args, so $@ is wrong
|
6 |
14391
|
aaronmk
|
|
7 |
14392
|
aaronmk
|
main()
|
8 |
|
|
{
|
9 |
|
|
pushd "$(dirname -- "${BASH_SOURCE[0]}")/.."
|
10 |
|
|
|
11 |
|
|
if test "${BASH_LINENO[1]}" = 0; then # was run without initial "."
|
12 |
|
|
echo "usage: . $self (note initial \".\")"|fold -s >&2
|
13 |
|
|
return 0 # not nonzero because this will close the shell
|
14 |
|
|
fi
|
15 |
|
|
|
16 |
|
|
set -x
|
17 |
|
|
|
18 |
|
|
make backups/TNRS.backup-remake &
|
19 |
|
|
dump_opts=${dump_opts---exclude-schema=public} \
|
20 |
14391
|
aaronmk
|
make backups/vegbien.$version.backup/test &
|
21 |
14392
|
aaronmk
|
sleep 10 # wait for backup files to be created
|
22 |
|
|
backups/fix_perms
|
23 |
14393
|
aaronmk
|
|
24 |
|
|
set +x
|
25 |
14392
|
aaronmk
|
}
|
26 |
|
|
main "$@"
|