This commit is contained in:
gospodar 2023-02-12 14:42:52 +01:00
parent 5203f65147
commit 2f66ba386f

View File

@ -1,18 +1,18 @@
Backify 🗃️ ## Backify 🗃️
=========== ===========
What is Backify? 👾 ### What is Backify? 👾
------------------- -------------------
Backify is a shell script that helps you automate the backup process of all kinds of data from Linux systems. It differs from other backup scripts because it gives you the flexibility to choose what you want to save, ranging from system logs to containers. The script was tailored to meet personal needs as there was no complete solution for the specific use case. Backify is a shell script that helps you automate the backup process of all kinds of data from Linux systems. It differs from other backup scripts because it gives you the flexibility to choose what you want to save, ranging from system logs to containers. The script was tailored to meet personal needs as there was no complete solution for the specific use case.
Prerequisites 👷 ### Prerequisites 👷
------------------- -------------------
- The script must be executed as root. - The script must be executed as root.
- A configuration file named `backup.cfg` must exist in the same directory as the script. - A configuration file named `backup.cfg` must exist in the same directory as the script.
@ -20,11 +20,10 @@ Prerequisites 👷
- The system must be either a Red Hat-based or an Ubuntu-based distribution. - The system must be either a Red Hat-based or an Ubuntu-based distribution.
### Configuration 🧙‍♂️
Configuration 🧙‍♂️
------------------- -------------------
All configuration options can be found in the `backup.cfg` file. The script has an integrity check in place to ensure that no external commands can be embedded into it by malware. The following table provides an overview of the available configuration options: All configuration options can be found in the `backup.cfg` file. The script has an integrity check in place to ensure that no external commands can be embedded into it by malware. The following table provides an overview of the available configuration options:
| Name | Value | Specifics | | Name | Value | Specifics |
@ -56,4 +55,34 @@ All configuration options can be found in the `backup.cfg` file. The script has
| db_username | ------> | Username for DB access | | db_username | ------> | Username for DB access |
| db_password | ------> | Password for DB access | | db_password | ------> | Password for DB access |
| db_name | ------> | Name of database | | db_name | ------> | Name of database |
| db_all | ------> | Dump all databases instead of specific one | | db_all | ------> | Dump all databases instead of specific one |
### Script Execution 🪄
-------------------
To execute the script, simply run the following command in the terminal:
> ./backify.sh
The script will first initialize by checking for the existence of the configuration file, loading its parameters, and verifying that the script is being executed as root.
Then, it will determine whether the system is a Red Hat-based or an Ubuntu-based distribution.
Finally, the script will create a new directory with a timestamped name in the backup_path directory, where the backups will be stored.
The components specified in the configuration file will then be backed up to the newly created directory.
### Automation 🤖
-------------------
Here's an example of how you can use cron on Linux to run your script every day at 12 PM:
Open the terminal and type crontab -e to open the cron table for editing.
Add the following line to the end of the file:
> 0 12 * * * /path/to/your/script.sh
Save and exit the file.