{"id":19179566,"url":"https://github.com/mathieubesson/backup-scripts","last_synced_at":"2025-10-11T02:09:06.626Z","repository":{"id":65565630,"uuid":"594492005","full_name":"MathieuBesson/backup-scripts","owner":"MathieuBesson","description":"This tool is designed to back up one or more servers to a dedicated machine.","archived":false,"fork":false,"pushed_at":"2024-08-31T16:36:14.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T01:44:13.874Z","etag":null,"topics":["bash","cli","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MathieuBesson.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":"2023-01-28T18:05:34.000Z","updated_at":"2024-08-31T16:36:37.000Z","dependencies_parsed_at":"2024-11-09T10:43:34.569Z","dependency_job_id":"1c46e04e-3987-4fe4-ae01-7354eedc39fb","html_url":"https://github.com/MathieuBesson/backup-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MathieuBesson/backup-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuBesson%2Fbackup-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuBesson%2Fbackup-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuBesson%2Fbackup-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuBesson%2Fbackup-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MathieuBesson","download_url":"https://codeload.github.com/MathieuBesson/backup-scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuBesson%2Fbackup-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005915,"owners_count":26083995,"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-11T02:00:06.511Z","response_time":55,"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":["bash","cli","shell"],"created_at":"2024-11-09T10:43:31.036Z","updated_at":"2025-10-11T02:09:06.586Z","avatar_url":"https://github.com/MathieuBesson.png","language":"Shell","readme":"# Backup Server Tool\n\nThis tool is designed to back up one or more servers to a dedicated machine.\n\n## Prerequisites\n\n- At least two Linux machines\n\nBefore using the various scripts (backup, restore, and checking the date of the last backup), you need to configure the servers to be backed up.\n\n### Set Up SSH Key Access (root) on the Servers to Be Backed Up\n\nYou must have [SSH key access](https://www.cyberciti.biz/faq/how-to-set-up-ssh-keys-on-linux-unix/) configured with the root user on the machine initiating the backups.\n\n### Configure the Backup Settings for the Servers\n\nDuplicate the `./secrets/var.dev.sh` file and rename it to `./secrets/var.sh` to define the backup configuration for the servers.\n\nNext, set the following information:\n\n#### Required Variables on the Backup Server (for each $SERVER to be backed up):\n\n- `NAME`: Server name (Note: this parameter must match the $NAME_CURRENT_SERVER value on the server)\n- `IP`: Server's IP address\n- `BACKUP_USER`: User to use for the backup (root is recommended to avoid losing file and folder ownership)\n- `FOLDER_BACKUP_SOURCE`: Folder to be backed up on the server\n- `FOLDER_BACKUP_TARGET`: Destination folder for backups on the backup server (initiating the backup) for the current server\n- `FOLDER_BACKUP_GLOBAL`: Parent backup folder (to group backups)\n- `FOLDER_BACKUP_PARAMETERS`: Configuration folder\n- `NUMBER_OF_DAYS_WITHOUT_WARNING`: Number of days without a backup before receiving notifications\n\nThen, provide the URL of a [Discord webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) to notify the administrator during a backup with the variable `DISCORD_WEBHOOK_URL`.\n\n#### Required Variable Only on the Server to Be Backed Up:\n\n- `NAME_CURRENT_SERVER`: Name of the server to be backed up (the machine's name, which can be equal to $HOST)\n\n## Additional Information\n\nYou can run the scripts more easily by creating symbolic links for the scripts in `/usr/bin`:\n\n```bash\nsudo ln -s {project-path}/bin/backup.sh /usr/bin/backup\nsudo ln -s {project-path}/bin/check-backup-time.sh /usr/bin/check-backup-time\nsudo ln -s {project-path}/bin/restore.sh /usr/bin/restore\n```\n\n## Using the Scripts\n\nThe following 3 scripts are now available:\n\n```bash\n# Backup a server (run on the backup server)\nsudo backup\n# OR\nsudo backup ichigo\n\n# Restore a server (run on the backup server)\nsudo restore ichigo ichigo ichigo-2023-01-29-22-34-28_1675028068_.tar.gz\n\n# Check the last backup date of the server (run on the server to be backed up)\nsudo check-backup-time\n```\n\n## Configuring Cron Jobs\n\nIt may be useful to run the scripts automatically at regular intervals. Scheduled tasks or cron jobs serve this purpose.\n\nYou can configure them on the backup server:\n\n```conf\n0 1 * * * root backup\n```\n\nAnd on the server to be backed up:\n\n```conf\n0 1 * * * root check-backup-time\n```\n\nThe tool [Crontab Guru](https://crontab.guru/) can help you configure your cron jobs more easily.\n\n## License\n\nThis project is licensed under the GPL License. See the [LICENSE](./LICENSE) file for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieubesson%2Fbackup-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathieubesson%2Fbackup-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieubesson%2Fbackup-scripts/lists"}