Last active
August 29, 2015 14:15
-
-
Save nari-ex/136cbdd6f80ce3cbee14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
set -euo pipefail | |
filepath=$1 | |
# 10MBytes/sec | |
filesize=$(du -m ${filepath} | awk '{print $1}') | |
sleep_time=0.1 | |
for num in $(seq 1 ${filesize}); | |
do | |
truncate -s $((${filesize}-${num}))M ${filepath} | |
sleep ${sleep_time} | |
done | |
\rm ${filepath} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment