-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
987 lines (755 loc) · 37.8 KB
/
index.html
File metadata and controls
987 lines (755 loc) · 37.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Multirename</title>
<meta property="og:title" content="Multirename" />
<meta property="og:locale" content="en_US" />
<link rel="canonical" href="https://multirename.github.io/" />
<meta property="og:url" content="https://multirename.github.io/" />
<meta property="og:site_name" content="multirename.github.io" />
<link href="/assets/css/style.css" rel="stylesheet">
</head>
<body>
<div class="container-lg px-3 my-5 markdown-body">
<h1 id="multirename">Multirename</h1>
<h2 id="multirename---a-shell-program-written-in-php">multirename - A shell program written in PHP</h2>
<h3 id="version-141">Version 1.4.1</h3>
<p>This program is made to use as shell program and also for batch processing.
This means: If you have tonns of files to be renamed or have always new files
which must be renamed: This program is made for you! I use it only in cronjobs.</p>
<p>Hello! Welcome to my program. I hope you will enjoy it!</p>
<p>Happy renaming!
Florian</p>
<p>:-)</p>
<p>Notice: Auto generated file. All documentation was bundled in the README.md.
For single text files have a look at the <a href="/flobee/multirename/tree/stable/docs">docs</a>)
Versions: The documentation at the wiki belongs to the stable branch / latest
stable release. This documentation belongs to the branch you switch to. The
latest version you will find at the “unstable” branch.</p>
<h1 id="summary">Summary</h1>
<ul>
<li><a href="#multirename">Multirename</a>
<ul>
<li><a href="#multirename-a-shell-program-written-in-php">multirename - A shell program written in PHP</a></li>
</ul>
</li>
<li><a href="#features">Features</a></li>
<li><a href="#examples-for-multirename">Examples for Multirename</a>
<ul>
<li><a href="#simple-replacements-substitutions">Simple replacements/ substitutions:</a></li>
<li><a href="#for-the-vdr-project-this-can-help">For the vdr project this can help:</a></li>
<li><a href="#synology-dtv-tv-recordings">Synology DTV TV recordings:</a></li>
</ul>
</li>
<li><a href="#install">Install</a>
<ul>
<li><a href="#downloads">Downloads</a></li>
<li><a href="#pre-install">Pre-Install</a></li>
<li><a href="#windows">Windows</a></li>
<li><a href="#developer-install">Developer install</a></li>
<li><a href="#the-program-comes-in-two-flavors">The program comes in two flavors</a></li>
</ul>
</li>
<li><a href="#build">Build</a>
<ul>
<li><a href="#build-options">Build options</a></li>
</ul>
</li>
<li><a href="#usage-of-multirename">Usage of Multirename</a>
<ul>
<li><a href="#forword">Forword</a></li>
<li><a href="#hints">Hints</a></li>
<li><a href="#usage-options-help">Usage options (–help)</a></li>
</ul>
</li>
<li><a href="#contributions">Contributions</a>
<ul>
<li><a href="#contributors-are-welcome">Contributors are welcome!</a></li>
<li><a href="#deployment">Deployment</a></li>
</ul>
</li>
<li><a href="#authors">Authors</a>
<ul>
<li><a href="#contributed-features">Contributed features</a></li>
<li><a href="#implemented-suggestions">Implemented suggestions</a></li>
<li><a href="#core-developers">Core developers</a></li>
</ul>
</li>
<li><a href="#history">History</a>
<ul>
<li><a href="#important-version-history-informations">Important version history informations</a></li>
</ul>
</li>
<li><a href="#changes-of-multirename">Changes of Multirename</a>
<ul>
<li><a href="#timeline">Timeline</a></li>
</ul>
</li>
<li><a href="#bugs">Bugs</a></li>
<li><a href="#license">License</a></li>
</ul>
<h1 id="features">Features</h1>
<ul>
<li>
<p>Simple replacements or removes.
Look for a sign and replace it with another one. E.g.: Change all spaces in
filenames with an underscore (_).</p>
</li>
<li>
<p>Replacements using pcre engine (Perl compatible regular expressions).
Regular expressions are patterns detection. With filenames it can help to
split complex names to rebuild the filename you need. E.g.:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>"2015-01-01-20.00.00 The daily news.mpg"
will become
"daily_news_-_2015-01-01.mpg"
</code></pre></div> </div>
</li>
<li>
<p>Find relevant files or directorys by a list of search keywords or regular
expressions.</p>
</li>
<li>
<p>Renaming including the path or breadcrumbs of the path the file belongs to.
The path or the parts of it are always available to be used for the
replacement.</p>
</li>
<li>
<p>Replacements including regular expressions and including path replacements
in a regular exression. E.g.: /(%path2%)?(.*)?(\d{5})?/i
Checkout the examples for more.</p>
</li>
<li>
<p>Creation of hard links or symlinks, relative or absolut instead of renaming
the files. Including relocating in this case. “this” goes “../in/here/that”</p>
</li>
<li>Possibility to undo an action. < version 1.3.3</li>
<li>
<p>Possibility to undo multiple or seletced actions from history > version 2.*</p>
</li>
<li>
<p>A test mode to check the results when starting a rename process.</p>
</li>
<li>
<p>Presets: Possibility to save/update/delete a configuration. E.g. for a later
usage or batch processing like cron, at, batch…</p>
</li>
<li>
<p>Scan for matches in a recusivly way or just files in the given directory.</p>
</li>
<li>
<p>Scan for matches including search function also able to use regular expr.</p>
</li>
<li>
<p>Excluding matches you dont want to rename</p>
</li>
<li>
<p>Scan for all files or a given list of file extensions. E.g.: doc;docx;xls</p>
</li>
<li>
<p>Using external scripts as plugins to assist the renaming befor or after the
internal renaming performs. E.g. loading a new name from a text file.</p>
</li>
<li>More features to come. Some are already in the code marked as TODO.</li>
</ul>
<h1 id="examples-for-multirename">Examples for Multirename</h1>
<h2 id="simple-replacements-substitutions">Simple replacements/ substitutions:</h2>
<h3 id="example">Example:</h3>
<p>Delete all spaces in filenames and replace it with an underscore and remove the
word “this” if it exists:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>multirename --path 'YOUR_PATH' \
--fileextensions '*' \
--substitutions ' =_;this' \
--keepcopy \
--test
or:
multirename --path 'YOUR_PATH' -e '*' -s ' =_;this' --keepcopy --test
</code></pre></div></div>
<h3 id="beautifing-hyphen-comma-and-colon">Beautifing hyphen, comma and colon?</h3>
<p>Your substitution could look like:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>--substitutions '-=_-_;,=_-_;:=_-_'
</code></pre></div></div>
<h3 id="show-a-saved-configuration">Show a saved configuration:</h3>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>multirename --from-config 'YOUR_PATH' --show-config --test
</code></pre></div></div>
<h3 id="use-a-saved-configuration">Use a saved configuration</h3>
<p>Use a saved configuration but test befor, then execute it and save the
configuration again (YOUR_PATH belongs to the path where your file are):</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>multirename --from-config 'YOUR_PATH' --test
multirename --from-config 'YOUR_PATH' --set-config
</code></pre></div></div>
<p>As you can see, using –test is always a good option to avoid problems!</p>
<h2 id="for-the-vdr-project-this-can-help">For the vdr project this can help:</h2>
<h3 id="example-1">Example 1:</h3>
<p>Check the difference in simple recordings and series recordings in vdr.
The following example is for simple recordings!
You may split your recordings in sub-folders like “movies” and “series”.
Change request for vdradmin-am already exists: http://projects.vdr-developer.org/issues/2137)</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>multirename --path 'YOUR_RECORDING_PATH_FOR_MOVIES' \
--fileextensions ts;m2t;mpg;mpeg; \
--substitutions ' =_;#3A=_-_;:_=_-_;regex:/^(\d{5}|info|marks)$/i=../%path2%_-_$1;_-_marks=.marks;_-_info=.nfo' \
--keepcopy \
--recursive \
--sub-paths \
--test
</code></pre></div></div>
<p>Would do e.g.:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>old: 00001.ts
new: ../True_Grit.ts
old: marks
new: ../True_Grit.marks
old: info
new: ../True_Grit.nfo
</code></pre></div></div>
<p>The default pattern for vdr recordings and maybe created mpg’s 00001.ts.mpg:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>regex:/^(\d{5}|\d{5}\.ts|info|marks)$/i
</code></pre></div></div>
<h3 id="example-2">Example 2:</h3>
<p>This example is for my series. When recording i use different subfolders like:
Movie, Series, Doc, DocSeries so i can run multirename automatically without
much attention. At the end of the substitutions parameter you find some specific
words for german television i dont want to have.:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>multirename --path 'YOUR_PATH_TO_SERIES' \
--fileextensions 'ts;m2t;mpg;mpeg' \
--substitutions ' =_;#3A=_-_;:_=_-_;regex:/^(\d{5}|info|marks)$/i=../../%path3%_-_%path1%_-_%path2%_-_$1;regex:/(\d{4}-\d{2}-\d{2})(.*.rec)(.*)/i=$1$3;_-_marks=.marks;_-_info=.nfo;regex:/(.*)(,(_Science-Fiction|_Action|_Drama),_USA_\d)(.*)/=$1;,_Scienc_=_;,_Magazin,_D;Thema_u._a._-_=ua_;,_Mag_-_=_-_;,_Magazin,;,_Magazi;,_Mag;,_Wissensmagazin,_D;_u._a.:_=_ua_' \
--keepcopy \
--recursive \
--sub-paths \
--test
</code></pre></div></div>
<p>Would do e.g. (in real i just create relative symlinks –link ‘soft;rel’ and
don’t rename the files!):</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>old: 00001.ts ...TO:
new. ../../The_Flash_-_2015-03-31_-_Der_Mann_in_Gelb_-_00001.ts
old: marks ...TO:
new: ../../The_Flash_-_2015-03-31_-_Der_Mann_in_Gelb.marks
old: info ...TO:
new: ../../The_Flash_-_2015-03-31_-_Der_Mann_in_Gelb.nfo
</code></pre></div></div>
<h2 id="synology-dtv-tv-recordings">Synology DTV TV recordings:</h2>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>multirename --path 'YOUR-SYNO-RECORDING-PATH' \
-e "ts;m2t;mpg;mpeg"
-s 'regex:/^(\d{4}-\d{2}-\d{2}_\d{4})?(.*)/i=$2_-_$1;regex:/(_.{1,20}_)+(.*?)(_-_\d{4}-\d{2}-\d{2}_\d{4})$/i=$2$3;regex:/(_-_)$/i; =_' \
--sub-paths \
--history \
--test
</code></pre></div></div>
<p>Would do e.g.:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>old: 2014-08-16_1410_RTL2_Merlin.ts
new: Merlin_-_2014-08-16_1410.ts
</code></pre></div></div>
<h1 id="install">Install</h1>
<h2 id="downloads">Downloads</h2>
<p>Getting the source you have serveral options:
<a href="https://github.com/flobee/multirename/releases">Download page for releases</a>
https://github.com/flobee/multirename/releases</p>
<h2 id="pre-install">Pre-Install</h2>
<p>(*nix based systems)</p>
<p>Install php and required modules:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code># and the suggested packages
apt-get install php5-cli php5-json
</code></pre></div></div>
<p>To be mentiond: The default shell:
For multirename it self: php is the shell. For shell scripts: /bin/dash was the
default shell. Some output may be different when using bash. ash seems to be
fine also.</p>
<h2 id="windows">Windows</h2>
<p>Please use cygwin (http://cygwin.com). Native support will be in the future)</p>
<h3 id="quick-install">Quick install</h3>
<p>(Unix/Linux/BSD based systems)</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>(copy & past)
cd /tmp
wget https://github.com/flobee/multirename/blob/testing/deploy/multirename\
-1.4.1.tgz?raw=true -O multirename-1.4.1.tgz
tar -xf multirename-1.4.1.tgz
chmod +x multirename.phar
mv multirename.phar /usr/local/bin/multirename
multirename --help
</code></pre></div></div>
<h2 id="developer-install">Developer install</h2>
<p>Checkout the code and required library:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/flobee/multirename.git
cd multirename/
# checkout and update stable|testing|unstable
sh ./helper/gitupdate.sh [optional: stable|testing|unstable]
</code></pre></div></div>
<p>The files you will call directly (if not already done):</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>chmod +x <file>
</code></pre></div></div>
<h2 id="the-program-comes-in-two-flavors">The program comes in two flavors</h2>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1) Standard php usage (the src directory must be/stay intact):
2) Single file usage (using a *.jar like file which is called "phar")
(you can delete all other files. Everything is in that file)
1. Possible options to run:
1.1: php /path/where/src/multirename.php [--help|options]
1.2: /path/where/src/multirename [--help|options]
1.3: Make it global available:
Became root
ln -s /path/where/src/multirename /usr/local/bin/
multirename [--help|options]
2. For users who just want to use the program. Possible options:
2.1: /path/where/build/multirename.phar [--help|options]
2.2: Make it global available:
copy or move /path/where/build/multirename.phar to /usr/local/bin/multirename
multirename [--help|options]
Or (but build directory must be intact):
ln -s /path/where/build/multirename.phar /usr/local/bin/multirename
multirename [--help|options]
</code></pre></div></div>
<h1 id="build">Build</h1>
<p>(build/make.php)</p>
<p>This is not a typical make but for most of you probably an interesting corner.</p>
<p>This shows you how to create your own multirename.phar file or building a new
release.</p>
<h2 id="build-options">Build options</h2>
<ol>
<li>php make.php install</li>
<li>php make.php clean</li>
<li>php make.php deploy</li>
</ol>
<h3 id="1-php-makephp-install">1.: php make.php install:</h3>
<p>You decided to use the bundled version (all files and required libraries in
one file) for an easy usage. Use the file multirename.phar, thats all!</p>
<p>If you want to build it by yourself, run: php make.php install</p>
<p>Note: This requires php >= 5.4 and changes in your php.ini:
Changes in the php.ini for the cli only is ok. The php.ini for web/ live
enviroment: STOP: NOT OK!</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>e.g.: /etc/php5/cli/php.ini; Change:
";phar.readonly = On" to
"phar.readonly = 0" (drop semicolon, On to 0 (Off))
</code></pre></div></div>
<p>Then you are able to create your own multirename.phar file whichs bundles
all nessasary files for the program to one file (Like *.jar files) and
you can use that file which is more easy to handle.</p>
<p>If you dont see any errors, the “multirename.phar” were created.
Please check if its working by running:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>php multirename.phar --help
</code></pre></div></div>
<p>The first line must show: “[INFO] Usage:”</p>
<p>The performance of this bundle is nearly the same than using the standard
sources for a php application (some people say it boost the performance…)
Well :-) less disk IO can make sence.</p>
<p>On upgrades only “multirename.phar” needs to be updated. Checkout the deploy/
directory where i will add final versions.</p>
<h3 id="2-php-makephp-clean">2.: php make.php clean:</h3>
<p>Drops files created within the make script</p>
<h3 id="3-php-makephp-deploy">3.: php make.php deploy</h3>
<p>Task for a new release of multirename or just updating the documentation. For
more please have a look in the <a href="#contributions">contributions section</a> or at the
docs/](./tree/stable/docs/CONTRIBUTE.txt)</p>
<h1 id="usage-of-multirename">Usage of Multirename</h1>
<h2 id="forword">Forword</h2>
<ul>
<li>
<p>At the moment only the filename without the file extension will be handled.</p>
</li>
<li>
<p>Internally always the long options will be used. If you use short options, no
problem, but if you want to see the saved configuration the long options will be
shown and used. Also as remark if you want to use the Mumsys_Multirename class
in php context e.g: in your own scripts this is the way.</p>
</li>
</ul>
<p>For the moment (may be for all the time):</p>
<ul>
<li>
<p>A logger tracks all actions to a log file (default in /tmp/ (max.3MB) if you
dont change it). This make sence in the current state of the program to find and
debug open or not detected bugs for you, me….</p>
</li>
<li>
<p>Configurations can be saved but only one config per path at the moment. (i’m
still thinking about to extend it or not! It make things complicated and a GUI
would be the next step to handle thouse parts. Maybe someone likes do it?</p>
</li>
</ul>
<h2 id="hints">Hints</h2>
<ul>
<li>When executing the program you may think something went wrong because it seems
that the programm hangs: Probably you have enabled the –keepcopy flag and there
is a hugh file which will be copied and not renamed! Dont break operations! This
can loose informations for recovery/ undo action. Have look at the log file
first (tail -f /tmp/multirename.$USER.log) befor stop the process.</li>
</ul>
<h2 id="usage-options-help">Usage options (–help)</h2>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>--test|-t
Flag: test before execute
--path|-p <yourValue/s>
Path to scann for files (tailing slash is important!) * Required
--fileextensions|-e <yourValue/s>
Semicolon separated list of file extensions to scan for eg.
"avi;AVI;mpg;MPG" or "*" (with quotes) for all files * Required
--substitutions|-s <yourValue/s>
Semicolon separated list with key value pairs for substitution eg:
--substitutions ä=ae;ö=oe;ß=ss; =_;'regex:/^(\d{5})$/i=x_\$1'... .As
simple feature you can use %path1%...%pathN% parameters to substitute
path informations in substitution values the file belongs to. For
moreinformation see --sub-paths but only use --sub-paths if you really
need it. It can became strange side effects when enabling it. * Required
--sub-paths
Flag; Enable substitution for paths. Feature for the substitution:
Breadcrumbs of the --path can be found/ substituted with %path1% -
%pathN% in reverse. If you want to rename files and want to add the
folder the file belongs to you can use %path1%. One folder above is
%path2% and so on until the given root in --path. Example:
/var/files/records => %path1% = records, %path2% = files, %path3% = var;
With this option you can also replace %pathN% in keys or values and also
in regular expressionsUse the --test flag and test and check the results
carefully! WARNING: Enabling this feature can change the behavior of
existing substitutions in your cmd line!
--find|-f <yourValue/s>
Find files. Semicolon seperated list of search keywords or regular
expressions (starting with "regex:"). The list will be handled in OR
conditons.The keyword checks for matches in any string of the file
location (path and filename). Optional
--exclude <yourValue/s>
Exclude files. Semicolon seperated list of search keywords or regular
expressions (starting with "regex:"). The list will be handled in OR
conditons.The keyword will be checked for matches in any string of the
file location (path and filename). Exclude will also ignore matches from
the --find option; Optional
--recursive|-r
Flag, if set read all files under each directory starting from --path
recursively
--keepcopy
Flag. If set keep all existing files
--hidden
Include hidden files (dot files)
--link <yourValue/s>
Don't rename, create symlinks or hardlinks, relativ or absolut to target
(Values: soft|hard[;rel|abs]). If the second parameter is not given
relativ links will be created
--linkway <yourValue/s>
Type of the link to be created relative or absolut: ("rel"|"abs"),
default: "rel". This will be used internally if you use --link soft;rel
the linkway will be extracted from that line
--history|-h
Flag; If set this will enable the history/ for the moment ONLY the last
action log with the option to undo it
--history-size <yourValue/s>
Integer; Number of history entrys if --history is enabled; Default: 10;
Note: If you run on much more than hundreds of files you may set the
memory limit to a higher value and/or reduce this number to 1. This
feature may consume much memory. Using the --test mode with loglevel 6
or higher will give you informations about the memory usage.
--batch
Flag; Not implemented yet. Run the job recusiv from given --path as
start directory and start renaming. If a new configuration in the sub
directories exists is trys to load the configuration for batch-mode and
execute it. This enables --recursiv and --history
--plugins
Not implemented yet. Semicolon separated list of plugins to use. Plugins
to use to do the renameing: eg.: You have a text file including the new
name of the file to be renameed: The pluging gets the file location and
you return the new filename befor or after the other rules take affect!
Example: --plugins 'TitleOfVDRInfoFile:before;CutAdvertising:after'
--undo
Flag; Revers/ undo the last action
--from-config <yourValue/s>
Read saved configuration from given path and execute it
--set-config
disabled; see --save-config
--save-config
Flag; Saves the configuration to the --path of the config which adds a
new folder ".multirename" for later use with --from-config
--del-config
Flag; Deletes the config from given --path
--show-config
Flag; Shows the config parameter from a saved config to check or rebuild
it. Use it with --from-config
--loglevel|--ll <yourValue/s>
Logging level for the output of messages (0=Emerg ... 7=verbose/debug).
For testing use 6 or 7; For cronjob etc. do not use lower than 5 to get
important messages
--version|-v
Flag; Return version informations
--help
Show this help
</code></pre></div></div>
<h1 id="contributions">Contributions</h1>
<h2 id="contributors-are-welcome">Contributors are welcome!</h2>
<p>Checkout a branch of stable|testing|unstable including updates and switching
to one of it and including the externals with updates, use the helper script:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./helper/gitupdate.sh [branchname]
</code></pre></div></div>
<p>I decide to use staging areas to keep the “stable” clean of bugs as good as
possible and for maximum of stability.</p>
<p>Stareas are “unstable” -> “testing” -> “stable”</p>
<p>“stable” should be always the latest stable release! (Incl. Hotfixes)</p>
<p>All new code/ development shoud go to “unstable”.
Also, if needed, to the externals which having also these staging areas.</p>
<p>If you would like to add features or push some improvements: The unstable branch
is basicly the entry point and the latest code base.
Checkout the “unstable” branch create a new branch for your part to start in.</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/flobee/multirename.git
cd multirename
./helper/gitupdate.sh unstable
git checkout -b yourNewBranch
</code></pre></div></div>
<p>Note: You may also create own branches for the existing externals</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd external/<name>
git checkout -b yourNewBranch
</code></pre></div></div>
<p>If tests exists and the function of fixed bugs, new features is verified it will
be merged to “testing” (collecting the updates, versions, features)… for the
next release candidate or sub releases.</p>
<p>Hotfixes will go to extra branches and will be merged directly to the “stable”.</p>
<p>When merging branches take a look into .gitmodules of <em>each</em> branch and verify
that the branches still map to the branch name of the master project.
E.g.: The branch “testing” of the project maps to the “testing” branch of the
submodules eg. the library, and so on.
For this reason you may use the helper script more often and follow this
workflow:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code># checkout given branch of the main project
# init, updates and pulls the submodules for the given branch
./helper/gitupdate.sh [unstable|testing|stable]
# After a merge, e.g.:
./helper/gitupdate.sh testing
git merge unstable
# you need to check if it maps to testing and not unstable branches
ls -al .gitmodules # which should link to the testing file
</code></pre></div></div>
<h2 id="deployment">Deployment</h2>
<p>The build/make.php file will help to create files for the deployment e.g. if you
would like to create new readme.md/wiki entrys or to create a release. All text
files in the docs/ are involved. If you modify them there using markdown syntax
the deployment and the creation with new documentation will be generated.</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Will generate .md files for the wiki and the summary file /README.md
php make.php deploy
# will also create a new tar file with the release version in /deploy (the
# version string must match to the current version of the multirename class)
php make.php deploy '1.0.0-RC1'
</code></pre></div></div>
<p>Please use <code class="highlighter-rouge">make.php clean</code> after a deploy to not commit those files to the
repository.</p>
<p>When commiting new stuff you should first commit the externals changes and at
least the project version. The external commit ID should map to the commit ID of
the project when other people will check it out. I know this is not that handy
but i have no other/better idea at the moment to handle it.</p>
<h1 id="authors">Authors</h1>
<h2 id="contributed-features">Contributed features</h2>
<Developer>
<Feature Description="">
## Implemented suggestions
<Name>
<Feature Description="">
## Core developers
Florian Blasel
# History
Multirename is mar users which have not that detailed knowlege using the
shell. Also me :-) but i know php and find my solution to help myself for a
solution to rename files like i need it. Multirename was born.
Nothing new! And maybe already done anywhere in any rename program.
Maybe some of my ideas you will find useful or finds a new home ... Hopfully it
will stay here :-)
The very beginning of this program was in ~2002 and now, again because of music
and video files the vdr (video disk recording) project gave me the idea to
finish this program including some features i was looking for.
## Important version history informations
### VERSION < 1.3.3
If you are updating to a newer version of multirename and your version is lower
than version 1.3.3 you need to update your existing configs. Beginning with
Version 2.0.0 the migration will be removed.
When executing some renaming please update the configs to the new structure by
using the --save-config flag.
e.g: multirename --from-config /path --save-config
# Changes of Multirename
2016-04-10
Mumsys_Multirename
- Improves handling of stored config files
A config can contain selveral sub configs e.g: one config for this file
extension and one config for that file extension and so on.
there is no config management at the moment. add some config or delete
the config file is currently supported. The thing at all: this config
will be called from now on (next version) the default "preset" and it
containts one of more configs.
- Update/ improves tests
- codecoverage 100%
- bugfix with --find option; fixes issue #3
- add --exclude option; fixes feature #5
- Version 1.4.1
2016-03-27
- Improves history handling
- Sets logger property to be private
- new version: 1.3.3
- Update/ improves tests
- codecoverage 100%
2015-10-25
- Adds --exclude option, Updates tests, fixes issue #5
- version 1.3.1
2015-08-09
- new Version: 1.3.0
- adds history tracking and "history-size" option
- Fixed incomplete bugfix in version 1.2.5 of _getRelevantFiles()
- Adds missing tests for the bugfix in 1.2.4, 1.2.5
- Updates/ improves inline/ php docs
2015-08-06
- new Version: 1.2.5
- Fixed incomplete bugfix in version 1.2.4
2015-08-01
- new Version: 1.2.4
- Fixes a fault in --find option when trying to find for several keywords
2015-06-24
- new Version: 1.2.3
- Improves output messages in test mode
- Adds --find option
- Improves crap index of run() method
- Adds method _substitution()
- Improves/ Updates tests
2015-05-24
Fixes handling of shell arguments in library; Fixes issue #1;
Set VERSION 1.2.1
## Timeline
- alpha version:
- Code freeze: 2015-03/04
- write and push existig tests first
- find bugs and fix them
- announce first pre release, 2015-04-22/23
- create preRelease branch/tag and make default branch
- bug hunting time. ask the people 2015-05-16
- release (master) 2015-05-16
- init staging areas:
- add testing and unstable branches
- new features :-)
- Stable version: 1.2.0 as release 1 2015-05-21
# Bugs
There are one or some and hopefully none!
Be sure using the --test mode and check all results! Have a look at the output
when substitution or search keywards having special characters e.g: ? & .. think the pcre engine does not like it but i haven't checked it yet.
Your help would be great to find bugs or add features and improvements.
# License
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined .
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of followe terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
</Feature></Name></Feature></Developer>
</div>
<script src="/assets/javascript/anchor-js/anchor.min.js"></script>
<script>anchors.add();</script>
</body>
</html>