Giter Club home page Giter Club logo

mastodon-backup's Introduction

Description Notes Author ProjectPage
Backup your essential Mastodon files to an S3 bucket!
This uses some simple scripts and cronjobs to create backups to a specified S3 bucket.
HasHooves

mastodon-backup

Backup your essential Mastodon files to an S3 bucket!

This set of scripts was created to automate some of the basic maintenance that I would normally use to cleanup and make backups of my mastodon instance.

Feel free to use this backup script to help keep your instance clean too!

Configure the AWS credentials

  • Install the AWS CLI
    • NOTE: This script requires that aws configure has already been completed for the root user before being ran for the first time

  • Fill out the example_config.sh file with your information for AWS, and then move it to config/config.sh

Prepare the script files

  • Set the two files as executable:
chmod +x backup.sh
chmod +x config/config.sh

Cronjobs

Setting up automated backups

  • Add this line to your root crontab to ensure that the backups are being ran daily and a log is being generated:
0 3 * * * /opt/mastodon-backup/backup.sh > /opt/mastodon-backup/logs/backup.log 2>&1

Weekly restart of server

  • Add this line to the root crontab to ensure that a weekly restart is occuring:
0 0 * * 0 /sbin/shutdown -r now

Automatic media cleanup

  • NOTE: This should be set for the mastodon account and not set as the root user

  • Add this line to the mastodon user's crontab to ensure that the media is being cleaned out daily and capped at 7 days:
@daily cd /home/mastodon/live && RAILS_ENV=production bin/tootctl media remove --days=7

Restart Cron

  • After making changes to crontab, restart the cron service:
sudo service cron restart

mastodon-backup's People

Contributors

hashooves avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.