File tree Expand file tree Collapse file tree
src/main/kotlin/info/skyblond/oam/command/media Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ Here is my workflow:
2032033 . Use ` oam media local walk -au <path/to/local/data> ` to generate a reference hash on the correct data (assuming data on your local drive is correct)
2042044 . Use ` oam media <barcode> walk -au <path/to/ltfs> ` to calculate the hash of files on tape, then store in the database.
2052055 . Use ` oam file check -m local -m <barcode> -n 2 ` to exam if every file is matched. This command should have no output if everything is correct.
206- 6 . Then copy the sample data to other two tapes. I keep 3 copies of the same data to ensure safety.
206+ 6 . Then copy the sample data to other two tapes and check . I keep 3 copies of the same data to ensure safety.
207207
208208Tips:
209209+ Using tools like TeraCopy, you can leave a checksum file on the tape. So I can check the file even I lost the database of this software.
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import org.jetbrains.exposed.sql.transactions.transaction
1919import java.util.*
2020import kotlin.io.path.fileSize
2121import kotlin.io.path.relativeToOrNull
22+ import kotlin.math.max
2223
2324object WalkCommand : CliktCommand(
2425 help = " Walk a given media to append, update or verify files."
@@ -95,7 +96,7 @@ object WalkCommand : CliktCommand(
9596 echo(" [I]Calculating hash for $relativePathString " )
9697 val t = System .currentTimeMillis() / 1000
9798 val hash = p.sha3(bufferSize * MB )
98- val dt = System .currentTimeMillis() / 1000 - t
99+ val dt = max( 1 , System .currentTimeMillis() / 1000 - t)
99100 echo(
100101 " [I]Finished $relativePathString , " +
101102 " $dt s, ${size / 1024 / 1024 / dt} MB/s"
You can’t perform that action at this time.
0 commit comments