Skip to content

Commit

Permalink
feat: added functionality to measure size of volume
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmoysrt committed Feb 4, 2024
1 parent 0fa1127 commit 9b62262
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@
```bash
docker run --rm -v <persistent-volume-name>:/data -v /path/to/backup:/app ghcr.io/swiftwave-org/volume-toolkit import
```
3. Measure the size of a persistent volume

a. Run the following command
```bash
docker run --rm -v <persistent-volume-name>:/data -v /path/to/backup:/app volume-toolkit size
```
b. The size of the persistent volume will be written in `/path/to/backup/size.txt` file in bytes format.
6 changes: 5 additions & 1 deletion volume_toolkit
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ elif [ "$1" == "import" ]; then
echo "dump.tar.gz not found"
exit 1
fi
elif [ "$1" == "size" ]; then
size=$(du -sb /data | awk '{print $1}')
printf "%s" "$size" > /app/size.txt
exit 0
else
echo "Usage: volume_export.sh [export|import]"
echo "Usage: [export|import|size]"
exit 1
fi

0 comments on commit 9b62262

Please sign in to comment.