Unix & Linux Asked by lmind on December 22, 2021
Trying to figure out the best approach to a script that will do the following:
So far, I’m thinking something along these lines:
for i in {1..25}
do
time sh -c "dd if=/dev/zero of=/user/home/test.img bs=10G count=1" >> /tmp/dd_timed.txt && time sh -c "rm -f /user/home/test.img" >> rm_timed.txt
done
Anyone have a better solution or could maybe tweak this a bit?
Ok, so it looks like here's the way to get this done. Looks nasty, but works:
#!/bin/bash
for i in {1..25}
do
{ time dd if=/dev/zero of=/home/user/test.img bs=1G count=10 oflag=direct >& / dev/null ; } 2>> /tmp/dd_timed.txt && { time rm /home/user/test.img >& /dev/null ; } 2>> /tmp/rm_timed.txt
done
Answered by lmind on December 22, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP