Compare commits

..

No commits in common. "d8ffc99fdd765aceff7bc13992e6f91302658103" and "e44e06594e207bacc2e37ed0809f24581e380c20" have entirely different histories.

4 changed files with 0 additions and 67 deletions

View File

@ -1,49 +0,0 @@
#!/bin/bash
set -e
PATH="$PATH:/usr/local/bin:/usr/sbin:/sbin"
GITEA_USER=${GITEA_USER:-git}
GITEA_CONFIG=${GITEA_CONFIG:-/etc/gitea/app.ini}
GITEA_WORK_PATH=${GITEA_WORK_PATH:-/var/lib/gitea}
GITEA_CUSTOM_PATH=${GITEA_CUSTOM_PATH:-$GITEA_WORK_PATH/custom}
GITEA_BACKUP_PATH=${GITEA_BACKUP_PATH:-$GITEA_WORK_PATH/backup}
GITEA_KEEP_DAYS=${GITEA_KEEP_DAYS:-7}
prereq() {
if ! systemctl list-units --full --all | grep -Fq "gitea.service"; then
printf "gitea.service unit does not exit\n"
exit 1
fi
if (( EUID != 0 )); then
printf "must be run as root\n"
exit 1
fi
}
main() {
prereq
if [ "$1" == "pre" ]; then
pushd "$GITEA_BACKUP_PATH" > /dev/null || printf "could not chdir to %s\n" "$GITEA_BACKUP_PATH"
printf "gitea dump started\n"
runuser -u "$GITEA_USER" -- \
gitea dump \
--config "$GITEA_CONFIG" \
--work-path "$GITEA_WORK_PATH" \
--custom-path "$GITEA_CUSTOM_PATH" > /dev/null
printf "gitea dump complete\n"
popd > /dev/null || printf "could not chdir to %s\n" "$OLDPWD"
elif [ "$1" == "post" ]; then
printf "purging gitea backups\n"
find "$GITEA_BACKUP_PATH" \
-type f \
-name '*.zip' \
-mtime "+$GITEA_KEEP_DAYS" \
-delete
fi
}
main "$@"

View File

@ -1,20 +1,10 @@
#!/bin/bash
set -e
SERVICE=minecraft.service
VAR_DIR=/opt/minecraft/var
WAIT=30
VERBOSE=${VERBOSE:-4}
prereq() {
local service=$1
if ! systemctl list-units --full --all | grep -Fq "$service"; then
printf "%s unit does not exit\n" "$service"
exit 1
fi
}
error_exit() {
printf "%s\n" "$1" >&2
exit 1
@ -85,8 +75,6 @@ open_files() {
main() {
prereq "$SERVICE"
if [ "$1" == "pre" ]; then
printf "stopping %s\n" $SERVICE
if ! stop_server $SERVICE; then

View File

@ -64,7 +64,6 @@ counter=0
sleep=1
rc=1
printf "restic started\n"
until [ $counter -eq "$MAX_ATTEMPTS" ] || [ $rc -eq 0 ]; do
if [ -r "$EXCLUDE_PATH" ]; then
$NICE "$RESTIC_PATH" backup -q --exclude-file="${EXCLUDE_PATH}" "${PATHS}"
@ -82,7 +81,6 @@ until [ $counter -eq "$MAX_ATTEMPTS" ] || [ $rc -eq 0 ]; do
(( counter++ ))
done
printf "restic complete\n"
if [ $rc -ne 0 ] && [ $counter -eq "$MAX_ATTEMPTS" ]; then
printf "restic job timed out, exiting\n"

View File

@ -26,10 +26,6 @@ util_packages:
misc:
- tmux
- moreutils
utils:
- unzip
- p7zip
- p7zip-full
security:
- gnupg
- pass