Gogs-Remote-Backup (run_gogs_remote_backup.sh) is a bash script to remotely back up key files/folders used in a Gogs installation using the secure remote copy (scp) command. Specifically, Gogs-Remote-Backup backs up the following:
- The PostgreSQL database used by Gogs
- The Gogs custom configuration file called
app.ini. This file is important, as it contains all configuration details regarding the current Gogs install - The Gogs Git repositories located in the
gogs-repositoriesfolder
Note: Gogs can be installed using other database options: this script currently only supports PostgreSQL.
Importantly, run_gogs_remote_backup.sh is intended to be used for making unattended script calls (e.g., running cron jobs) into a set of related Git projects configured as Git submodules, making it easy to use this project as a front-end while the supporting submodule projects get updated independently. The two submodule projects are:
- Postgresql-Db-Dump, used to remotely dump a PostgreSQL database
- Remote-Folder-Copy, used to remotely copy a folder
- An operational bash environment (bash 4.3.46 used during development)
- The requirements of each of the two submodule projects used in this project. Note that each submodule project will alert the user to missing dependencies at runtime
While this package was written and tested under Linux (Ubuntu 16.10), there should be no reason why this won't work under other Unix-like operating systems.
Be sure to review and edit the contents of the Gogs-Remote-Backup script (run_gogs_remote_backup.sh) to customize script parameters and folder options.
Note: Gogs-Remote-Backup really only serves as a wrapper for Postgresql-Db-Dump and Remote-Folder-Copy, so a good understanding of the parameters passed into these scripts is important.
Because Gogs-Remote-Backup is intended to run unattended, the only usage is to call the script directly, with no additional parameters passed on the command line.
$ ./run_gogs_remote_backup.sh
This project uses Git submodule projects (located in the postgresql-db-dump and the remote-folder-copy folders) to keep this project up-to-date without manual intervention.
Be sure to clone this project with the --recursive switch (git clone --recursive https://github.com/richbl/this_project) so any submodule project(s) will be automatically cloned as well. If you clone into this project without this switch, you'll likely see empty submodule project folders (depending on your version of Git).
