The backups [*] 2022-06-03_11-44-46.tar.gz 2022-10-02_19-37-55.tar.gz 2022-11-02_02-02-49.tar.gz 2022-11-10_15-05-00.tar.gz 2022-11-28_08-53-43.tar.gz 2022-12-07_15-02-20.tar.gz 2022-12-20_13-54-32.tar.gz 2023-01-04_11-03-10.tar.gz -- total of 15G -- [*] what is included - everything in the database i.e. all user account, posts etc - everything uploaded by users ------------------------------------------------------------------------- the script: ------------------------------------------------------------------------- #!/bin/sh # NOTE : RUN WITH SUDO echo RUN WITH SUDO # CHANGE THIS TO YOUR OWN CONFIG PLEROMA_DB=___ BACKUP_DIR=___ PLEROMA_INSTALL=___ PLEROMA_UPLOADS=___ # in most cases you don't need to change these POSTGRES_USER=postgres TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S) DUMP_DIR=/tmp/pleroma_dump/$TIMESTAMP echo [$TIMESTAMP] backup job started mkdir -p $DUMP_DIR if [ $? -eq 0 ]; then echo [$TIMESTAMP] dump dir created: $DUMP_DIR else echo [$TIMESTAMP] failed to create dump dir, exit. exit 127 fi sudo pg_dump --username=$POSTGRES_USER -d $PLEROMA_DB \ --format=custom -f $DUMP_DIR/postgres.dump if [ $? -eq 0 ]; then echo [$TIMESTAMP] postgres db dumpted else echo [$TIMESTAMP] DB dump failed fi cp $PLEROMA_INSTALL/config/prod.secret.exs $DUMP_DIR/prod.secret.exs cp $PLEROMA_INSTALL/config/setup_db.psql $DUMP_DIR/setup_db.psql echo [$TIMESTAMP] creating archive tar -czvf $BACKUP_DIR/$TIMESTAMP.tar.gz -C $DUMP_DIR . -C \ $PLEROMA_UPLOADS . >> /dev/null if [ $? -eq 0 ]; then echo [$TIMESTAMP] archive created rm -rf $DUMP_DIR fi