{"id":25627053,"url":"https://github.com/emadasefi/rsyncbackup","last_synced_at":"2026-04-15T16:32:22.529Z","repository":{"id":266989844,"uuid":"899964195","full_name":"emadasefi/rSyncBackup","owner":"emadasefi","description":"The rSyncBackup Bash script automates the backup process by utilizing rsync to transfer files from specified remote servers to local directories.","archived":false,"fork":false,"pushed_at":"2024-12-07T14:19:27.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-13T16:03:19.892Z","etag":null,"topics":["automation","bash-script","rsync-backup","shell-script"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emadasefi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-12-07T13:54:30.000Z","updated_at":"2025-01-21T09:30:56.000Z","dependencies_parsed_at":"2024-12-07T14:39:43.140Z","dependency_job_id":null,"html_url":"https://github.com/emadasefi/rSyncBackup","commit_stats":null,"previous_names":["emadasefi/rsyncbackup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emadasefi/rSyncBackup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emadasefi%2FrSyncBackup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emadasefi%2FrSyncBackup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emadasefi%2FrSyncBackup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emadasefi%2FrSyncBackup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emadasefi","download_url":"https://codeload.github.com/emadasefi/rSyncBackup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emadasefi%2FrSyncBackup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31849739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["automation","bash-script","rsync-backup","shell-script"],"created_at":"2025-02-22T17:32:19.095Z","updated_at":"2026-04-15T16:32:22.511Z","avatar_url":"https://github.com/emadasefi.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"rSyncBackup Script (automating backups across multiple servers)\n====================================\nThis Bash script automates the process of backing up files from specified remote servers to designated local directories using rsync. It includes logging capabilities for monitoring the backup operations and handles password authentication using sshpass.\n\u003cbr\u003e\u003cbr\u003e\n\n## 🌟 Key Features\n\u003cli\u003e\u003cstrong\u003eAutomated Backup:\u003c/strong\u003e The script facilitates automatic backups from specified remote servers to designated local directories, eliminating the need for manual intervention.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eEfficient Transfer:\u003c/strong\u003e Utilizing rsync, the script efficiently transfers files by only copying changed data, which minimizes bandwidth usage and speeds up the process.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eLogging Capabilities:\u003c/strong\u003e It logs essential information such as the start and end times of backup operations, along with any errors encountered during the process. This ensures that users can monitor and review backup activities effectively.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eArchiving Previous Backups:\u003c/strong\u003e To prevent data loss, the script archives previous backups with timestamps. This feature allows users to maintain historical versions of their data.\u003c/li\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n## 🌟 Implementation Details\n\u003cli\u003e\u003cstrong\u003ePrerequisites:\u003c/strong\u003e The script requires bash, rsync, and sshpass for password authentication. It is also recommended to set up passwordless SSH access for seamless operation.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eScheduling:\u003c/strong\u003e The script can be scheduled to run at regular intervals using a cron job, ensuring that backups are performed consistently without user input.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eError Handling:\u003c/strong\u003e While basic logging is included, users are advised to implement additional error handling mechanisms to address potential issues during backup operations.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eUsage Scenarios:\u003c/strong\u003e The script can be adapted for various use cases, such as backing up web server files, databases, or personal data across different systems.\u003c/li\u003e\n\u003cli\u003eThis automation not only enhances data security by ensuring regular backups but also simplifies the management of backup processes across multiple servers.\u003c/li\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n## 💡 Configuration Section :\n```shell\ndeclare -A SOURCE_SERVERS=(\n    [\"user@192.168.162.11:22:/backends\"]=\"password11:/mnt/storage/backup/backends-11\"\n    [\"user@192.168.162.12:2223:/etc/nginx\"]=\"password12:/mnt/storage/backup/nginx-12\"\n)\n\nARCHIVE_BASE=\"/mnt/storage/backup/archive\"\nLOG_DESTINATION=\"/mnt/storage/backup\"\nCURRENT_DATE=$(date +\"%Y-%m-%d_%H-%M-%S\")\n```\n\u003cbr\u003e\n\u003cli\u003e\u003cstrong\u003eAssociative Array:\u003c/strong\u003e SOURCE_SERVERS holds the mapping of source server details (\u003cstrong\u003euser\u003c/strong\u003e, \u003cstrong\u003eIP\u003c/strong\u003e, \u003cstrong\u003eport\u003c/strong\u003e, and \u003cstrong\u003epath\u003c/strong\u003e) to their respective passwords and local backup destinations.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eDirectories:\u003c/strong\u003e ARCHIVE_BASE is where previous backups are stored, and LOG_DESTINATION is where log files are saved.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eCurrent Date:\u003c/strong\u003e The current date and time are captured for use in logging and archiving.\u003c/li\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n## 📜 Conclusion\n\u003cli\u003e This Bash script is a robust solution for automating backups across multiple servers while ensuring data integrity through archiving and comprehensive logging. By using tools like \u003ccode\u003ersync\u003c/code\u003e and \u003ccode\u003esshpass\u003c/code\u003e, it simplifies file transfers while managing passwords securely within a controlled environment. \u003c/li\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n## — Feedback ❤️—\nPlease leave a comment if you have any comments, suggestions or problems.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femadasefi%2Frsyncbackup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femadasefi%2Frsyncbackup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femadasefi%2Frsyncbackup/lists"}