Skip to content

Commit 037e8ef

Browse files
committed
README use-case
1 parent 2398dba commit 037e8ef

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

README.md

+31-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# fertilize -- retry the same thing, expect different results
22

33

4-
# SYNOPSIS
4+
## SYNOPSIS
55

66
Sometimes spawning a child process is not successful.
77
This attempts to `fertilize` the *process* by being stubborn,
@@ -10,7 +10,7 @@ Therefore this isn't quite the same as "crazy",
1010
which people like to quote.
1111

1212

13-
# MOTIVATION
13+
## MOTIVATION
1414

1515
The following is just a use-case.
1616
Retrying stuff can be justified / useful, even with computers...
@@ -28,7 +28,9 @@ until done. If no number is provided, it will use some hardcoded default,
2828
which supposedly has better chances than the otherwise usual rsync once.
2929

3030

31-
# EXAMPLE
31+
## EXAMPLE
32+
33+
All about `rsync`...
3234

3335
fertilize 3 rsync something /dev/null
3436

@@ -39,6 +41,32 @@ Be careful with `fertilize 0 something` - it easily becomes an infinite loop...
3941
So be convinced the `something` is likely to exit with a status of `0`.
4042
Zero (being success) is fitting for an exit, it otherwise goes on for infinity.
4143

44+
Back to the motivation / use-case...
45+
46+
This was prompted by a need to move some files from HFS to NTFS. NTFS because
47+
it's the most reliable file-system that I can currently mount with both Mac OS
48+
and Linux. Cut & paste produced some weird errors and rsync periodically does
49+
the broken pipe thing. The NTFS-3G driver, being kind of slow, made it worse.
50+
I wish I could just use ZFS...
51+
52+
So here is how I tend to move files:
53+
54+
fertilize 999 rsync -ptr --partial --size-only --remove-source-files --stats {source} {target}/
55+
56+
It preserves permissions (if possible) and the timespamps,
57+
syncs the files recursively, removes whatever is synced,
58+
and provides stats in the end.
59+
60+
The stats are those of the last run and only if successful up to attempt `999`,
61+
so they are just indicator of overall success, especially useful if your prompt
62+
doesn't display exit status. The source directories are kept around - as there
63+
doesn't seem to be an option for removing them as well. I don't use `--progress`
64+
with this - it would print a line every second. Maybe there is or will be
65+
some other way to pass on child process stdout (without doing console.log)?
66+
67+
Of-course rsync is useful for all kinds of copying and stuff --
68+
like keeping files in sync, backup, etc.
69+
4270

4371
## INSTALL
4472

0 commit comments

Comments
 (0)