From 856ffb9fea595484d0bd36c07d194dc618e4c64a Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 14 Mar 2025 11:50:19 +0100 Subject: [PATCH] Optimized .mds and meta/main.yml for backup-remote-to-local --- .../backup-remote-to-local/Administration.md | 25 ++++++++++ roles/backup-remote-to-local/README.md | 49 +++++++++---------- roles/backup-remote-to-local/meta/main.yml | 26 ++++++++++ 3 files changed, 74 insertions(+), 26 deletions(-) create mode 100644 roles/backup-remote-to-local/Administration.md diff --git a/roles/backup-remote-to-local/Administration.md b/roles/backup-remote-to-local/Administration.md new file mode 100644 index 00000000..f5c104e6 --- /dev/null +++ b/roles/backup-remote-to-local/Administration.md @@ -0,0 +1,25 @@ +# Administration Tasks + +## Debug Instructions + +### Live Monitoring + +To track what the service is doing, execute one of the following commands: + +#### Using systemctl + +```bash +watch -n2 "systemctl status backup-remote-to-local.cymais.service" +``` + +#### Using journalctl + +```bash +journalctl -fu backup-remote-to-local.cymais.service +``` + +### Viewing History + +```bash +sudo journalctl -u backup-remote-to-local.cymais.service +``` \ No newline at end of file diff --git a/roles/backup-remote-to-local/README.md b/roles/backup-remote-to-local/README.md index 51fa3167..8874ca3d 100644 --- a/roles/backup-remote-to-local/README.md +++ b/roles/backup-remote-to-local/README.md @@ -1,34 +1,31 @@ -# role backup-remote-to-local +# Backup Remote to Local -## goal -This script allows to pull backups from a remote server. +## Description -## scheme -It is part of the following scheme: -![backup scheme](https://www.veen.world/wp-content/uploads/2020/12/server-backup-768x567.jpg)
-Further information you will find [in this blog post](https://www.veen.world/2020/12/26/how-i-backup-dedicated-root-servers/). +This role pulls backups from a remote server and stores them locally using rsync with retry logic. It is designed to retrieve remote backup data and integrate with your overall backup scheme. -## debug +## Overview -### live -To track what the service is doing execute one of the following commands: +Optimized for Archlinux, this role is a key component of a comprehensive backup system. It works in conjunction with other roles to ensure that backup data is collected, verified, and maintained. The role uses a Bash script to pull backups, manage remote connections, and handle incremental backup creation. -#### systemctl -```bash - watch -n2 "systemctl status backup-remote-to-local.cymais.service" -``` +## Purpose -#### journalctl -```bash - journalctl -fu backup-remote-to-local.cymais.service -``` +Backup Remote to Local is a robust solution for retrieving backup data from remote servers. By leveraging rsync, it creates incremental backups that support both file and database recovery. This ensures the integrity and security of your backup data across distributed environments. -### history -```bash - sudo journalctl -u backup-remote-to-local -``` +## Features -## see -- https://superuser.com/questions/363444/how-do-i-get-the-output-and-exit-value-of-a-subshell-when-using-bash-e -- https://gist.github.com/otkrsk/b0ffd4018e8a79b9010c461af298471e -- https://serverfault.com/questions/304125/rsync-seems-incompatible-with-bashrc-causes-is-your-shell-clean \ No newline at end of file +- **Remote Backup Retrieval:** Pulls backups from a remote server using secure SSH connections. +- **Incremental Backup with rsync:** Uses rsync with options for archive, backup, and hard linking to efficiently manage changes. +- **Retry Logic:** Implements a retry mechanism to handle transient network issues or remote errors. +- **Integration with Other Roles:** Works alongside roles like backup-directory-validator, cleanup-failed-docker-backups, systemd-timer, backups-provider, and system-maintenance-lock. +- **Administrative Debugging:** Detailed debug instructions and administrative tasks are provided in a separate file. + +## Further Information + +- **Backup Scheme:** + ![backup scheme](https://www.veen.world/wp-content/uploads/2020/12/server-backup-768x567.jpg) + More details can be found in [this blog post](https://www.veen.world/2020/12/26/how-i-backup-dedicated-root-servers/). + +## Administration & Debugging + +For detailed debug instructions and administrative tasks, please refer to the [Administration Tasks](Administration.md) file. diff --git a/roles/backup-remote-to-local/meta/main.yml b/roles/backup-remote-to-local/meta/main.yml index cab5e4a5..e71e0ce6 100644 --- a/roles/backup-remote-to-local/meta/main.yml +++ b/roles/backup-remote-to-local/meta/main.yml @@ -1,3 +1,29 @@ + +--- +galaxy_info: + author: "Kevin Veen-Birkenbach" + description: "Pulls backups from a remote server and stores them locally using rsync with retry logic. This role is part of a comprehensive backup scheme and works in conjunction with other roles to ensure reliable backup operations." + license: "CyMaIS NonCommercial License (CNCL)" + license_url: "https://s.veen.world/cncl" + company: | + Kevin Veen-Birkenbach + Consulting & Coaching Solutions + https://www.veen.world + min_ansible_version: "2.9" + platforms: + - name: Archlinux + versions: + - rolling + galaxy_tags: + - backup + - remote + - local + - docker + - systemd + - automation + repository: "https://s.veen.world/cymais" + issue_tracker_url: "https://s.veen.world/cymaisissues" + documentation: "https://s.veen.world/cymais" dependencies: - git - systemd-notifier