Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Staff
watcher
Commits
be82ae5b
Commit
be82ae5b
authored
11 years ago
by
Michael J. Smith
Browse files
Options
Download
Email Patches
Plain Diff
Added speed tracking
parent
15d1eb46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
watcher
watcher
+11
-6
No files found.
watcher
View file @
be82ae5b
...
...
@@ -18,16 +18,21 @@ if [[ ! -f ./startDate ]]
date
+%s
>
./startDate
fi
date1
=
$(
cat
startDate
)
startTime
=
$(
cat
startDate
)
dirPath
=
$1
prevSize
=
"
$(
du
-sk
"
$dirPath
"
|
cut
-f1
-
)
"
counter
=
0
speed
=
0
while
(
true
)
;
do
timerString
=
"
$(
date
-u
--date
@
$((
$(
date
+%s
)
-
date1
-
86400
))
+%-j:%H:%M:%S
)
"
humanSizeString
=
"
$(
du
-sh
"
$dirPath
"
|
cut
-f1
-
)
"
sizeString
=
"
$(
du
-s
"
$dirPath
"
)
"
outString
=
"
$timerString
\t
$humanSizeString
\t
$sizeString
"
curTime
=
"
$(
date
+%s
)
"
timerString
=
"
$(
date
-u
--date
@
$((
curTime
-
startTime
-
86400
))
+%-j:%H:%M:%S
)
"
curSize
=
"
$(
du
-sk
"
$dirPath
"
|
cut
-f1
-
)
"
humanSizeString
=
"
$(
du
-sh
"
$dirPath
"
)
"
speedString
=
"
$((
((
curSize
-
prevSize
)
/
1024
)
/
frequency
))
MB/s"
outString
=
"
$timerString
\t
$curSize
\t
$humanSizeString
\t
$speedString
"
filteredOutString
=
$(
echo
-ne
"
$outString
"
|
grep
-v
"cannot access"
-
)
echo
-ne
"
$filteredOutString
\r
"
prevSize
=
$curSize
sleep
"
$frequency
"
done
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment