{"id":30281883,"url":"https://github.com/theunixdemon/makemirrorimages","last_synced_at":"2025-10-29T06:21:51.623Z","repository":{"id":292937820,"uuid":"982400600","full_name":"TheUnixDemon/MakeMirrorImages","owner":"TheUnixDemon","description":"An automation Bash script with `rsync` as base to mirroring folders.","archived":false,"fork":false,"pushed_at":"2025-05-12T22:38:38.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T13:32:58.289Z","etag":null,"topics":["linux-administration","linux-automations","linux-service","linux-timer","rsync","rsync-backup-script"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheUnixDemon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-12T20:33:44.000Z","updated_at":"2025-05-12T22:34:40.000Z","dependencies_parsed_at":"2025-05-12T23:20:22.582Z","dependency_job_id":"fb75c176-0048-4a9d-bfc4-95475fde358f","html_url":"https://github.com/TheUnixDemon/MakeMirrorImages","commit_stats":null,"previous_names":["theunixdemon/makemirrorimages"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TheUnixDemon/MakeMirrorImages","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheUnixDemon%2FMakeMirrorImages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheUnixDemon%2FMakeMirrorImages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheUnixDemon%2FMakeMirrorImages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheUnixDemon%2FMakeMirrorImages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheUnixDemon","download_url":"https://codeload.github.com/TheUnixDemon/MakeMirrorImages/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheUnixDemon%2FMakeMirrorImages/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281572746,"owners_count":26524252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux-administration","linux-automations","linux-service","linux-timer","rsync","rsync-backup-script"],"created_at":"2025-08-16T16:55:54.827Z","updated_at":"2025-10-29T06:21:51.606Z","avatar_url":"https://github.com/TheUnixDemon.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mirroring\n\nThis little project is about making a simple automated mirror image from a target *dir* to a wished destination *dir*. This will be made with **rsync**. \n\nIt's not about making a incremental backup systems but only to sync a set of data to a wished location. So we have a backup from the current set of data. (If it's about making a incremental backup you could look after **borgbackup**.)\n\n# How it works\n\nThis automation script is seperated into some Bash scripts. To start the process execute `main.sh` but before you have to define the directories for the mirroring wihin `main.sh`. Also exclusion directories can be defined in the `exclude.txt`.\n\n## Detailed explaination\n\nHere a short look into the scripts and other files located in the folder `./App`. \n\n* [`main.sh`](./App/main.sh)\n    * defines the directories which will been mirrored\n    * where `checkDir.sh` and `mirror.sh` will be loaded and executed\n* [`checkDirs.sh`](./App/checkDirs.sh)\n    * checks if the defined directories exists and if not it exits the process\n* [`mirror.sh`](./App/mirror.sh)\n    * makes a mirror image from `targetDir` to `destinationDir` with `rsync -av ...`\n    * `exclude.txt`\n        * *excluding directories* for mirroring process\n\n# Deploy as a Service\n\nAfter testing the Bash script can be implemented with `Systemd` using a *Daemon* (Service) to do that. Also it is helpful and more efficient to use a timer implemented as a `*.timer` file. I created for that a template for the Daemon and the Timer. Both have to be the same basename (here `mirroring`). So the Timer and the Daemon only differ in the suffix and both have to be saved in `/etc/systemd/system/`.\n\n## Template\n\n* [`mirroring.service` - Daemon](./Service/mirroring.service)\n* [`mirroring.timer` - Timer](./Service/mirroring.timer)\n\n## Step by step deployment\n\nMoving the templates into the right folder for enabling the Timer.\n\n```bash\n#!/bin/bash\nsudo su\nmv Service/mirroring.* /etc/systemd/system\nsystemctl daemon-reload\nsystemctl enable --now mirroring.timer # for starting *mirroring.service* through that\n```\n\nAfter that check if the Daemon is set using Timer as initializer abd the Timer for the Daemon is enabled and set to the wished time. Here an example how it can look like if set up right.\n\n```bash\n#!/bin/bash\n$ systemctl status mirroring.service\n○ mirroring.service - creates with *rsync* mirroring backups\n     Loaded: loaded (/etc/systemd/system/mirroring.service; static)\n     Active: inactive (dead)\nTriggeredBy: ● mirroring.timer\n\n$ systemctl status mirroring.timer\n● mirroring.timer - weeky mirror backup sync\n     Loaded: loaded (/etc/systemd/system/mirroring.timer; enabled; preset: enabled)\n     Active: active (waiting) since Tue 2025-05-13 00:24:46 CEST; 6min ago\n    Trigger: Sun 2025-05-18 05:00:00 CEST; 5 days left\n   Triggers: ● mirroring.service\n```\n\nNow you can make a test run through the Daemon itself to check if it will work out as wished. You can check out the `*.log` files if you want to follow up with the progress of the Daemon.\n\n```bash\nsudo systemctl start mirroring.service\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheunixdemon%2Fmakemirrorimages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheunixdemon%2Fmakemirrorimages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheunixdemon%2Fmakemirrorimages/lists"}