Skip to content

Commit

Permalink
Update the Fim documentation for 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
evrignaud committed Oct 22, 2015
1 parent 565e222 commit 235790e
Show file tree
Hide file tree
Showing 7 changed files with 263 additions and 187 deletions.
4 changes: 2 additions & 2 deletions samples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/sample1/
/sample2/
/simple-example/
/sample*/
6 changes: 3 additions & 3 deletions samples/sample1.sh → samples/simple-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
# along with Fim. If not, see <http://www.gnu.org/licenses/>.
#-----------------------------------------------------------------------------------------------------------------------

rm -rf sample1
mkdir sample1
rm -rf simple-example
mkdir simple-example

set +x
(
cd sample1
cd simple-example
echo
echo \# Create a set of files
for i in 01 02 03 04 05 06 07 08 09 10 ; do echo "New File $i" > file$i ; done
Expand Down
71 changes: 34 additions & 37 deletions src/main/asciidoc/how-can-i-use-fim.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,60 +30,57 @@ the two shell script files located in the root directory.
** `fim` for Linux or Mac OS X
** `fim.bat` for Windows

[[step-by-step-procedure]]
It generates also two distribution files into the `target/dist` directory.

[source]
---------------------------
$ ls -a1 target/dist/
fim-1.0.0-SNAPSHOT-distribution.tar.gz
fim-1.0.0-SNAPSHOT-distribution.zip
---------------------------

== Step by step procedure

_This procedure is a contribution done by
http://linuxfr.org/nodes/106724/comments/1622498[El Titi]_
Here are some tips on how you can build it easily.

=== Getting Maven

If you don't have maven, you can either download it from http://maven.apache.org/index.html[here] or use packages managers.

First, it install maven. If you already have it you can skip the 2 first
lines. `/usr/local/bin/mvn` should be replaced with the path where `mvn`
is installed.
==== For Linux

=== For OS X
[source]
-----------------------------------------------------------------------------------------
sudo apt-get install maven
-----------------------------------------------------------------------------------------

==== For Mac OS X

[source]
-----------------------------------------------------------------------------------------
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install maven
cd
mkdir git
cd git
git clone https://github.com/evrignaud/fim.git
cd fim/
/usr/local/bin/mvn clean install
./fim
-----------------------------------------------------------------------------------------

=== For Linux
Then you need to add the `maven/bin` directory into your `PATH`.

=== Clone Fim

[source]
---------------------------------------------------------------------------------------
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
brew install maven
-----------------------------------------------------------------------------------------
cd
mkdir git
cd git
mkdir projects
cd projects
git clone https://github.com/evrignaud/fim.git
cd fim/
/usr/local/bin/mvn clean install
./fim
---------------------------------------------------------------------------------------

== Build a Fim distribution
-----------------------------------------------------------------------------------------

If you want to generate a Fim distribution type the following command:
=== Build Fim

[source]
---------------------------
mvn clean install -Pdistrib
---------------------------

It generates two distribution files into the `target/dist` directory.
---------------------------------------------------------------------------------------
mvn clean install
[source]
---------------------------
$ ls -a1 target/dist/
fim-1.0.0-SNAPSHOT-distribution.tar.gz
fim-1.0.0-SNAPSHOT-distribution.zip
---------------------------
# Now Fim is ready
./fim
---------------------------------------------------------------------------------------
4 changes: 2 additions & 2 deletions src/main/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
<p>
<a href="https://github.com/evrignaud/fim"><img
style="position: fixed; top: 0; right: 0; border: 0; z-index: 1000; margin: 0;"
src="images/fork_me_on_github-top-right.png" alt="Fork me on GitHub">
src="images/fork_me_on_github-top-right.png" alt="Fork me on GitHub"/>
</a>
<a href="#"><img
style="position: fixed; bottom: 0; right: 0; border: 0; z-index: 1000; margin: 20px 20px 20px;"
src="images/icons/back_to_top.png" alt="Back to top">
src="images/icons/back_to_top.png" title="Back to top" alt="Back to top"/>
</a>
</p>
++++
Expand Down
17 changes: 9 additions & 8 deletions src/main/asciidoc/real-life-example.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

== Initialize the big Fim repository

Here is the output of the initialization of a big Fim repository that contains 297 GB of photos and videos.
Here is the output of the initialization of a big Fim repository that contains 297 GB of photos and videos. +
In my case *it takes 2 hours* to hash all the files content.

[source,shell]
Expand Down Expand Up @@ -59,14 +59,14 @@ oooooooooooooooooo#ooooooooooo..oo@...ooooo#o
41453 added
----

== Check quickly for differences
== Check very quickly for differences

It is possible to check the differences very quickly using the `-k` option that will check only the second 4 KB block.
It is possible to check the differences very quickly using the `-s` option that will check only 3 small blocks of 4 KB. +
In my case *it takes 4 minutes :=)*.

[source,shell]
----
~/Photos_Videos$ fim diff -k
~/Photos_Videos$ fim diff -s
2015/07/21 08:49:21 - Info - Scanning recursively local files, hash second 4 KB block, using 2 thread
(Hash progress legend for files grouped 10 by 10: # > 200 MB, @ > 100 MB, O > 50 MB, o > 20 MB, . otherwise)
.o#...........................................o@o...............OO.oO.......O.......................
Expand Down Expand Up @@ -121,9 +121,9 @@ Nothing modified

== Check more accurately for differences

This quick diff can be inaccurate.
To increase accuracy, you can use the `-m` option. This result is more accurate,
but it cannot be completely accurate as only the hash of the second 1 MB block of the files are computed.
Using the super fast mode can produce inaccurate results. *You can miss modified files.* +
To increase accuracy, you can use the fast mode using the `-f` option that will check 3 medium blocks.
But it cannot be completely accurate as we only hash 3 different 1 MB blocks of the files. +
This time in my case, *it takes 20 minutes* to check the differences.

[source,shell]
Expand Down Expand Up @@ -188,5 +188,6 @@ This time in my case, *it takes 2 hours* as for the `init` command.

== Checking without hashing

There is also the fast mode using the `-f` option that do not hash file content. It helps to detect faster changes but only file names that have changed.
There is also the do not hash mode using the `-n` option that will not hash the files content.
It helps to detect faster changes but you will be able to detect only file names and file attributes that have changed. +
This time in my case, *it takes 3 seconds*.
Loading

0 comments on commit 235790e

Please sign in to comment.