1
1
# fertilize -- retry the same thing, expect different results
2
2
3
3
4
- # SYNOPSIS
4
+ ## SYNOPSIS
5
5
6
6
Sometimes spawning a child process is not successful.
7
7
This attempts to ` fertilize ` the * process* by being stubborn,
@@ -10,7 +10,7 @@ Therefore this isn't quite the same as "crazy",
10
10
which people like to quote.
11
11
12
12
13
- # MOTIVATION
13
+ ## MOTIVATION
14
14
15
15
The following is just a use-case.
16
16
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,
28
28
which supposedly has better chances than the otherwise usual rsync once.
29
29
30
30
31
- # EXAMPLE
31
+ ## EXAMPLE
32
+
33
+ All about ` rsync ` ...
32
34
33
35
fertilize 3 rsync something /dev/null
34
36
@@ -39,6 +41,32 @@ Be careful with `fertilize 0 something` - it easily becomes an infinite loop...
39
41
So be convinced the ` something ` is likely to exit with a status of ` 0 ` .
40
42
Zero (being success) is fitting for an exit, it otherwise goes on for infinity.
41
43
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
+
42
70
43
71
## INSTALL
44
72
0 commit comments