{"id":25831299,"url":"https://github.com/arg0wak/rpi-backup-utility","last_synced_at":"2025-06-17T22:34:39.935Z","repository":{"id":207970353,"uuid":"720463228","full_name":"arg0WAK/rpi-backup-utility","owner":"arg0WAK","description":"Designed specifically for Raspberry Pi devices, this backup script provides gzip-powered instant compression when creating images. This allows you to effectively compress and backup disk images of your Raspberry Pi systems. Furthermore, this tool supports Debian Bookworm as well as all other distributions.","archived":false,"fork":false,"pushed_at":"2025-05-12T17:22:55.000Z","size":55,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T18:33:21.736Z","etag":null,"topics":["backup-script","backup-utility","cronjob","raspberry-pi","rpi","rpi3","rpi4","shell-script"],"latest_commit_sha":null,"homepage":"https://arg0wak.github.io/rpi-backup-utility/","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/arg0WAK.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-11-18T15:08:51.000Z","updated_at":"2025-05-12T17:22:58.000Z","dependencies_parsed_at":"2025-02-28T20:45:38.409Z","dependency_job_id":null,"html_url":"https://github.com/arg0WAK/rpi-backup-utility","commit_stats":null,"previous_names":["barisalby/rpi-backup-utility","arg0wak/rpi-backup-utility"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/arg0WAK/rpi-backup-utility","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arg0WAK%2Frpi-backup-utility","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arg0WAK%2Frpi-backup-utility/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arg0WAK%2Frpi-backup-utility/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arg0WAK%2Frpi-backup-utility/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arg0WAK","download_url":"https://codeload.github.com/arg0WAK/rpi-backup-utility/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arg0WAK%2Frpi-backup-utility/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260450900,"owners_count":23011170,"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-script","backup-utility","cronjob","raspberry-pi","rpi","rpi3","rpi4","shell-script"],"created_at":"2025-02-28T20:33:18.170Z","updated_at":"2025-06-17T22:34:34.914Z","avatar_url":"https://github.com/arg0WAK.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cspan\u003e\n  \u003ca href=\"https://choosealicense.com/licenses/mit/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\" alt=\"MIT License\"\u003e\n  \u003c/a\u003e\n\u003c/span\u003e\n\n\u003ch1\u003eRaspberry Pi Backup Utility\u003c/h1\u003e\n\n![Raspberry Pi Backup Utility Bash Screen](https://arg0wak.github.io/gist/images/Raspberry%20Pi%20Backup%20Utility/2FCO7024XSO5VIC.jpg)\n\nDesigned specifically for Raspberry Pi devices, this backup program provides gzip-powered instant compression when creating images. This allows you to effectively compress and backup disk images of your Raspberry Pi systems. Furthermore, this tool supports Debian Bookworm as well as all other distributions.\n\nScript is coded thinking Crontab installation compability. After once introducing your backup device, no further input is expected from you. After the process is complete, it outputs a result and unmounts your device for security purposes. At the script each start, it checks whether the device is connected or not, and if there is no device on the previously connected slot, you will be prompted to identify your current backup device. Unlike the standard `dd` image creation method, it performs instant `gzip compression` every `128K blocks`. In the example data, a `58 GB` image is reduced to about `3 GB`. Loss tests were performed and successful results were obtained. Since multiple backup files over time are likely to cause storage space problems in your backup path, the oldest `2` backup files are deleted from the hard disk depending on the creation date every `5` backups. If you want to customize this value, please check **Warnings** section.\n\nAlso see the end of this article for Cron installation instructions.\n\n## 👀 Preview\n![Raspberry Pi Backup Utility Bash Screen](https://arg0wak.github.io/gist/images/Raspberry%20Pi%20Backup%20Utility/2rw95-hwju0.gif)\n\n## 🚨 Warnings\n\n### Customize System Destination\nIf you are using a Raspberry Pi external device or if your operating system is running from a different drive on your RPI device, please configure the following line in the script file before starting this process.\n\n`SYSTEM=\"/dev/mmcblk0\"`\n\n**mmcblk0**: Multi Media Card\n\n### Backup Limit on Mass Storage\nIf you want to update the target number to check for old backups, update the `BACKUP_COUNT` variable in the script. Changing this value will cause the condition checker to edit.\n\nYou can update the number of data to be deleted via the `EXPECTED_COUNT` variable.\n\n**Default Values:**\n`BACKUP_COUNT=5`\n`EXPECTED_COUNT=2` \n\n## ⛓️ Dependencies\n\nDependent packages are given below. These are the packages that come installed in almost every Linux distribution.\n```bash\n  lsblk\n  dd\n  gzip\n```\n\n## 🚀 Installation\n\nFirst of all clone the repo to your device using the link below.\n```bash\n  $ git clone git@github.com:arg0WAK/rpi-backup-utility.git\n  $ cd rpi-backup-utility\n```\n\nUpdate all your packages.\n```bash\n  $ sudo apt update -y\n  $ clear\n```\nRun bash script with superadmin privilages.\n```bash\n  $ sudo sh rpi_backup_utility.sh\n```\nHere you need to define the location where the device image will be backed up.\nYour sda, sdb, sdc and NVMe spaces will be colored on the lsblk. The displayed values list your connected devices. Devices with ExFAT file system do not need any partition. In such a case, the location you need to assign will be /dev/sda. Devices with other file systems come with one or more partitions. In this case the path you need to assign will be /dev/sdaX. \n\n`X = Partition number`\n\n```bash\n  NAME        TYPE\n  loop0       loop\n  loop1       loop\n  loop2       loop\n  sda         disk\n  mmcblk0     disk\n  ├─mmcblk0p1 part\n  └─mmcblk0p2 part\n\nENTER HARD DRIVE MOUNT POINT: ~ (ex: /dev/sda1):\n````\nSit back and the rest of the process will start automatically. \\\n\\\n**DON'T WRITE ANY DATA TO THE SYSTEM AND DON'T PULL OFF BACKUP STORAGE DURING THIS TIME!**\\\n\nAt the end of the process you will get a like below type result output.\n```bash\nLATEST BACKUP FILE:\nFile: F5-RASP-ARG0-2023-11-18.img.gz | Size: 2811.87 MB | Modification Date: 2023-11-18 18:19\n```\n## Crontab Installation\nYou need to perform cron operations to run the script automatically at certain times and to take a backup to an already mounted device.\n\nFirstly run crontab.\n```bash\n$ sudo crontab -e\n```\nYou'll see the following lines. Select any editor and continue.\n```bash\nSelect an editor.  To change later, run 'select-editor'.\n  1. /bin/nano        \u003c---- easiest\n  2. /usr/bin/vim.tiny\n  3. /bin/ed\n\nChoose 1-3 [1]:\n```\nAdd the following line at the bottom of the displayed comment lines. \\\nThis line means run the relevant script at 3 AM on the first day of every month.\n```bash\n0 3 1 * * sudo sh /path/to/rpi_backup_utility.sh\n```\n\n### Simple Crontab Scheme\n\n```bash\n* * * * * command to be executed\n- - - - -\n| | | | |\n| | | | ------ Day of week (0 - 7) (Sunday=0 or 7)\n| | | ------- Month (1 - 12)\n| | --------- Day of month (1 - 31)\n| ----------- Hour (0 - 23)\n------------- Minute (0 - 59)\n```\n\n*Enjoy it!*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farg0wak%2Frpi-backup-utility","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farg0wak%2Frpi-backup-utility","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farg0wak%2Frpi-backup-utility/lists"}