2019-01-06 14:14:47 -06:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
if [ "$1" = "-v" -o "$1" = "--verbose" ]; then
|
|
|
|
VERBOSE='--verbose'
|
|
|
|
PROGRESS='--progress'
|
|
|
|
CONFIG='/srv/envs/${envname}/app/rattail.conf'
|
|
|
|
else
|
|
|
|
VERBOSE=
|
|
|
|
PROGRESS=
|
|
|
|
CONFIG='/srv/envs/${envname}/app/silent.conf'
|
|
|
|
fi
|
|
|
|
|
|
|
|
RATTAIL="/srv/envs/${envname}/bin/rattail --config=$CONFIG $PROGRESS $VERBOSE"
|
2024-07-25 10:08:41 -05:00
|
|
|
# nb. avoid rich-formatted traceback here since it's so "noisy"
|
|
|
|
export _TYPER_STANDARD_TRACEBACK=1
|
2019-09-30 15:37:21 -05:00
|
|
|
|
2019-09-11 19:28:58 -05:00
|
|
|
|
|
|
|
# sanity check
|
|
|
|
if [ "$HOME" != '/root' ]; then
|
|
|
|
echo ''
|
|
|
|
echo '$HOME is not /root - please run this as e.g.:'
|
|
|
|
echo ''
|
|
|
|
echo ' sudo -H backup-everything [--verbose]'
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-01-06 14:14:47 -06:00
|
|
|
|
2019-09-30 15:37:21 -05:00
|
|
|
# upgrade app
|
|
|
|
/srv/envs/${envname}/app/upgrade.sh $VERBOSE
|
2019-01-06 14:14:47 -06:00
|
|
|
|
|
|
|
# run backup
|
|
|
|
cd /srv/envs/${envname}
|
|
|
|
$RATTAIL backup
|