{"id":26299253,"url":"https://github.com/flohoss/serverbackup","last_synced_at":"2025-03-15T06:47:53.922Z","repository":{"id":41567204,"uuid":"435237714","full_name":"flohoss/ServerBackup","owner":"flohoss","description":"A bash backup script for restic and rclone","archived":false,"fork":false,"pushed_at":"2023-02-15T10:36:06.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-06T01:52:54.573Z","etag":null,"topics":["backup","docker","docker-compose","rclone","restic","server","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"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/flohoss.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}},"created_at":"2021-12-05T17:48:15.000Z","updated_at":"2022-07-20T20:02:33.000Z","dependencies_parsed_at":"2023-01-20T01:04:27.592Z","dependency_job_id":null,"html_url":"https://github.com/flohoss/ServerBackup","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flohoss%2FServerBackup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flohoss%2FServerBackup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flohoss%2FServerBackup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flohoss%2FServerBackup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flohoss","download_url":"https://codeload.github.com/flohoss/ServerBackup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243695495,"owners_count":20332626,"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","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":["backup","docker","docker-compose","rclone","restic","server","shell"],"created_at":"2025-03-15T06:47:53.814Z","updated_at":"2025-03-15T06:47:53.903Z","avatar_url":"https://github.com/flohoss.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://img.shields.io/badge/Basics-Shell-informational?style=for-the-badge\u0026logo=gnubash\u0026color=4EAA25)\n\n# Backup-script to run in linux with restic, rclone and pcloud\n\nMake sure to install **docker compose V2 globally** if you are running the script as root:\n\n[https://docs.docker.com/compose/cli-command/](https://docs.docker.com/compose/cli-command/)\n\nA working rclone config file is needed. Feel free to change the backup function to your favoured backup command.\n\nThis script will go through all the folders in, for example, /opt/docker/ and execute a docker-compose stop command to run a backup to a remote pCloud location. The stop command only happens if the docker folder has been specified in the list to be stopped before backup. If the docker folder is called nextcloud it will enable maintenance mode as long as the backup is running. The restic repository in pCloud will be initialized before every backup run.\n\nOnce the script is running without errors, the crontab example can be used to run it every night and create logs in a separate folder.\n\n## example folder structure\n\n```\n/opt/\n│\n└─── docker/\n│   │\n│   └─── nextcloud/\n│   │   │  docker-compose.yml\n│   │   │  ...\n│   │\n│   └─── gitea/\n│       │  docker-compose.yml\n│       │  ...\n│   \n└─── backup/\n    │  -rwxr-xr-x root:root backup.sh\n    │  -rw-r--r-- root:root crontab.txt\n    │  -rw------- root:root .environment\n    │  -rwxr-xr-x root:root prepareBackup.sh\n    │  -rw------- root:root .resticpwd\n    │  -rwxr-xr-x root:root restic.sh\n    │  ...\n    └─── logs/\n        └─── 2021/\n        │   └─── ...\n        │   └─── 10/\n        │   │   └─── ...\n        │   │   └─── 2021-10-06.txt\n        │   │   └─── ...\n        │   └─── 11/\n        │   └─── ...\n        └─── 2022/\n            └─── ...\n            └─── 10/\n            └─── 11/\n            │   └─── ...\n            │   └─── 2022-11-06.txt\n            │   └─── ...\n            └─── ...\n```\n\n## environment variables used in the script\n\n```prepareBackup.sh``` will copy ```.environment``` in ```/etc/environment```\n\n```bash\nPINGURL=\"https://health.example.de/ping/\u003chealth_check_ping_id\u003e\"\nDOCKERDIR=\"/opt/docker/\"\nBACKUPDIR=\"/opt/backup/\"\nPCLOUDLOCATION=\"Backups/server1/\"\nRESTIC_PASSWORD_FILE=\"/opt/backup/.resticpwd\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflohoss%2Fserverbackup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflohoss%2Fserverbackup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflohoss%2Fserverbackup/lists"}