{"id":15598696,"url":"https://github.com/lukechilds/autoscale-do-block-storage","last_synced_at":"2025-04-28T10:42:27.752Z","repository":{"id":66309073,"uuid":"220140034","full_name":"lukechilds/autoscale-do-block-storage","owner":"lukechilds","description":"Autoscale Digital Ocean block storage volumes","archived":false,"fork":false,"pushed_at":"2023-11-02T10:28:00.000Z","size":23,"stargazers_count":20,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T08:41:37.622Z","etag":null,"topics":["bash","cloud","digitalocean","sysadmin"],"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/lukechilds.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":"2019-11-07T03:05:12.000Z","updated_at":"2024-03-13T02:04:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"57f12972-3f96-4167-874b-354f9aa7b8c0","html_url":"https://github.com/lukechilds/autoscale-do-block-storage","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fautoscale-do-block-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fautoscale-do-block-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fautoscale-do-block-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fautoscale-do-block-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukechilds","download_url":"https://codeload.github.com/lukechilds/autoscale-do-block-storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249420341,"owners_count":21268826,"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":["bash","cloud","digitalocean","sysadmin"],"created_at":"2024-10-03T01:41:02.897Z","updated_at":"2025-04-18T03:31:16.880Z","avatar_url":"https://github.com/lukechilds.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# checkvolumesize\n\n\u003e Autoscale Digital Ocean block storage volumes\n\nCreate a Digital Ocean block storage volume and write as much data to it as you want. Run this script on cron to monitor the volume and automatically scale it up in size as required with zero downtime.\n\nDon't worry about manually resizing or running out of space and save money by only paying for what you use.\n\nInspired by this feature request:\n- https://twitter.com/lukechilds/status/1192252814262599680\n- https://ideas.digitalocean.com/ideas/BSX-I-6\n\n## Usage\n\n```\n$ checkvolumesize --help\ncheckvolumesize 1.0.0\n\nAutomatically expand Digital Ocean block storage volumes.\n\nUsage: checkvolumesize [options]\n\nOptions:\n\n  --help | -h | help    [Optional] Show this help message\n  --token               [Required] Digital Ocean API token\n  --device              [Required] The volume's block device or mount point\n  --volume-name         [Required] The volume's name\n  --volume-region       [Required] The volume's region\n  --buffer              [Optional] The amount of GB to keep available    Default: 10\n  --log                 [Optional] Prepend timestamps to stdout\n\nExample:\n\n  checkvolumesize /\n    --token bc99be9f73b037da64074472fe58f643e619328b85c5467615964a59abd12029 /\n    --device /mnt/block-storage /\n    --volume-name volume-sgp1-01 /\n    --volume-region sgp1 /\n    --buffer 10\n\nGitHub: https://github.com/lukechilds/autoscale-do-block-storage\n```\n\n## Demo\n\n```\n$ checkvolumesize --token bc99be9f73b037da64074472fe58f643e619328b85c5467615964a59abd12029 --device /dev/sda --volume-name volume-sgp1-01 --volume-region sgp1 --buffer 10\nChecking available space on device \"/dev/sda\" is above 10GB requirement...\nOnly 8GB available, volume resize required\nGetting data for volume \"volume-sgp1-01\" in region \"sgp1\"...\nVolume ID is \"2cbebc6a-ff42-11e9-a238-0a58ac14a19d\" and is currently 430GB\nIncreasing volume size to 440GB...\nCreated action \"796611989\"\nWaiting for action to complete...\nVolume resize complete!\nResizing filesystem...\nresize2fs 1.44.1 (24-Mar-2018)\nFilesystem at /dev/sda is mounted on /mnt/volume_sgp1_01; on-line resizing required\nold_desc_blocks = 54, new_desc_blocks = 55\nThe filesystem on /dev/sda is now 115343360 (4k) blocks long.\nFilesystem resize complete!\nDevice \"/dev/sda\" now has 17GB available\nCompleted in 16 seconds\n```\n\n## Installation\n\nClone this repo and add `checkvolumesize` to your path. Then add a cron job as root.\n\n```\n*/10 * * * * checkvolumesize [options] --log \u003e\u003e /var/log/checkvolumesize.log\n```\n\nYou may also need to add:\n\n```\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n```\n\nto your root crontab for the script to be able to find the `resize2fs` binary.\n\nYou can view the log in `/var/log/checkvolumesize.log`\n\n```\n2019-11-07 11:30:01 Checking available space on device \"/dev/sda\" is above 10GB requirement...\n2019-11-07 11:30:01 19GB available, all good!\n2019-11-07 11:40:01 Checking available space on device \"/dev/sda\" is above 10GB requirement...\n2019-11-07 11:40:01 Only 8GB available, volume resize required\n2019-11-07 11:40:01 Getting data for volume \"volume-sgp1-01\" in region \"sgp1\"...\n2019-11-07 11:40:03 Volume ID is \"2cbebc6a-ff42-11e9-a238-0a58ac14a19d\" and is currently 430GB\n2019-11-07 11:40:03 Increasing volume size to 440GB...\n2019-11-07 11:40:10 Created action \"796611989\"\n2019-11-07 11:40:10 Waiting for action to complete...\n2019-11-07 11:40:17 Volume resize complete!\n2019-11-07 11:40:17 Resizing filesystem...\n2019-11-07 11:40:17 resize2fs 1.44.1 (24-Mar-2018)\n2019-11-07 11:40:17 Filesystem at /dev/sda is mounted on /mnt/volume_sgp1_01; on-line resizing required\n2019-11-07 11:40:17 old_desc_blocks = 54, new_desc_blocks = 55\n2019-11-07 11:40:17 The filesystem on /dev/sda is now 115343360 (4k) blocks long.\n2019-11-07 11:40:17 Filesystem resize complete!\n2019-11-07 11:40:17 Device \"/dev/sda\" now has 17GB available\n2019-11-07 11:40:17 Completed in 16 seconds\n2019-11-07 11:50:01 Checking available space on device \"/dev/sda\" is above 10GB requirement...\n2019-11-07 11:50:01 17GB available, all good!\n```\n\n## License\n\nMIT © Luke Childs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukechilds%2Fautoscale-do-block-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukechilds%2Fautoscale-do-block-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukechilds%2Fautoscale-do-block-storage/lists"}