Skip to content

Instantly share code, notes, and snippets.

View gjorando's full-sized avatar

Guillaume JORANDON gjorando

View GitHub Profile
@nolanlawson
nolanlawson / mastodon_backup.sh
Last active December 23, 2022 21:06
Script to back up a Mastodon instance (for non-dockerized installs)
#!/usr/bin/env bash
#
# Make a backup file of a Mastodon instance. The backup file is a TGZ containing
# the Postgres dump as well as the /public/system (media) files and the
# .env.production file. For loading the dump file contents, see:
# https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Migration-guide.md
#
# Usage: ./mastodon_backup.sh my_dump_file.tgz
#
# Advanced usage: MASTODON_LIVE_DIRECTORY=/path/to/live ./mastodon_backup.sh my_dump_file.tgz
#!/usr/bin/env sh
set -- $(locale LC_MESSAGES)
yesptrn="$1"; noptrn="$2"; yesword="$3"; noword="$4"
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
input_sink=$(pacmd stat |grep -o -P "(?<=Default source name: ).*")
output_sink=$(pacmd stat |grep -o -P "(?<=Default sink name: ).*")
echo "Input:" $input_sink