[pg_dump](https://www.postgresql.org/docs/9.5/static/app-pgdump.html) is an utility that comes with PostgreSQL that can be used extract the contents of a
If you are looking for a pre-written set of scripts to maintain PostgreSQL backups using pg_dump, you can find them [here](https://wiki.postgresql.org/wiki/Automated_Backup_on_Linux).
## User generated content (images, avatars, headers)
Day to day usage of a production Mastodon instance will result in user
generated content such as images, user avatars and headers. This data needs
to be backed up regularly.
If the [Production Guide](../Running-Mastodon/Production-Guide.md) is used, this
content will be stored in `/home/mastodon/live/public/system`.
Various methods can be used to back up this directory, here are some:
* [rsync](https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps) to an offsite backup server
* Synced to an AWS S3 bucket using the [AWS CLI tool](http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html)
## Mastodon application secrets
It is also highly recommended to keep your application configuration file
.env.production backed up.
If you the [Production Guide](../Running-Mastodon/Production-Guide.md) is used
this file is stored in `/home/mastodon/live/.env.production`.
That file contains application secrets used for things like 2 factor authentication and VAPID keys used for Web Push notifications.