How many bytes are on that mount?


Recommended Posts

I'm trying to calculate how fast a backup is being transfered.

How do I get the number of bytes in use on a particular mount? Can I assign that number to a shell variable?

Also, if I set dates like:

RIGHTTHEN=`date`

RIGHTNOW=`date`

Is there any built in way to get the difference between the dates in minuets or seconds?

the simple algorithm for the backup process is as follows:

1. mount source and destination devices/shares

2. set OLDSIZE to the current size of the destination mount

3. set STARTDATE to the date/time before backup

4. use rsync to run the backup

5. set NEWSIZE to the new size of the destination mount

6. set ENDDATE to the date/time after the backup

7. compute speed of backup

8. email backup log with all that nice info

I've got it all figured out except for subtracting the 2 dates, and assigning the OLDSIZE and NEWSIZE.

any help would be great.

Thanks!

-nic

p.s. i already see a flaw in my algorithm. If it is a fresh backup, and all files are new then it will calculate the speed fine. But if any files are written on top of (because they were modified) then the NEWSIZE - OLDSIZE won't tell me how much data was transfered. Any ideas on that one?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.