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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (c) 2016 Joost van Baal-Ilić <joostvb-draai@mdcc.cx> -->
<head>
<meta name="keywords" content="manual">
<style type="text/css">
/* START aephea.base.css */
body
{ text-align: justify;
margin-left: 0%;
margin-right: 0%;
}
a:link { text-decoration: none; }
a:active { text-decoration: none; }
a:visited { text-decoration: none; }
a:link { color: #1111aa; }
a:active { color: #1111aa; }
a:visited { color: #111166; }
a.local:link { color: #11aa11; }
a.local:active { color: #11aa11; }
a.local:visited { color: #116611; }
a.intern:link { color: #1111aa; }
a.intern:active { color: #1111aa; }
a.intern:visited { color: #111166; }
a.extern:link { color: #aa1111; }
a.extern:active { color: #aa1111; }
a.extern:visited { color: #661111; }
a.quiet:link { color: black; }
a.quiet:active { color: black; }
a.quiet:visited { color: black; }
div.verbatim
{ font-family: monospace;
margin-top: 1em;
margin-bottom: 1em;
font-size: 10pt;
margin-left: 2em;
white-space: pre;
}
div.indent
{ margin-left: 8%;
margin-right: 0%;
}
.right { text-align: right; }
.left { text-align: left; }
.nowrap { white-space: nowrap; }
.item_leader
{ position: relative;
margin-left: 8%;
}
.item_compact { position: absolute; vertical-align: baseline; }
.item_cascade { position: relative; }
.item_leftalign { text-align: left; }
.item_rightalign
{ width: 2em;
text-align: right;
}
.item_compact .item_rightalign
{ position: absolute;
width: 52em;
right: -2em;
text-align: right;
}
.item_text
{ position: relative;
margin-left: 3em;
}
.smallcaps { font-size: smaller; text-transform: uppercase }
/* END aephea.base.css */
body { font-family: "Garamond", "Gill Sans", "Verdana", sans-serif; }
body
{ text-align: justify;
margin-left: 8%;
margin-right: 8%;
}
</style>
<title>dr_symlinks</title>
</head>
<body>
<p style="text-align:right">
22 дец 2016
<a class="local" href="dr_symlinks.ps"><b>dr_symlinks</b></a>
20180520
</p>
<a name="name"></a>
<h2>NAME</h2>
<p style="margin-bottom:0" class="asd_par">
dr_symlinks — maintain a symlink forest</p>
<a name="synopsis"></a>
<h2>SYNOPSIS</h2>
<p style="margin-bottom:0" class="asd_par">dr_symlinks</p>
<a name="description"></a>
<h2>DESCRIPTION</h2>
For each pair directory/subdirectory under each word in DR_SL_TARGETS, a
directory and symlink DR_SL_SOURCE/directory/symlink is created (or adjusted).
The script is implemented as a wrapper around oggsymlinks, by Wessel Dankers.
<a name="example"></a>
<h2>EXAMPLE</h2>
If, in the configuration file $HOME/.draai/symlinksrc, DR_SL_SOURCE is set to
/srv/audio and DR_SL_TARGETS is set to "../data/a ../data/b", while directories
<div class="verbatim">
/srv/data/a/And_You_Will_Know_Us_By_the_Trail_of_Dead/Source_Tags_And_Codes/
/srv/data/a/And_You_Will_Know_Us_By_the_Trail_of_Dead/The_Century_of_Self/
/srv/data/a/John_Coltrane/A_Love_Supreme/
/srv/data/b/John_Coltrane/Giant_Steps/
/srv/data/b/Tinariwen/Amassakoul/
</div>
exist, the following directories holding the following symlinks will get created
in /srv/audio/ :
<div class="verbatim">
And_You_Will_Know_Us_By_the_Trail_of_Dead/Source_Tags_And_Codes ->
../../../a/And_You_Will_Know_Us_By_the_Trail_of_Dead/Source_Tags_And_Codes/
And_You_Will_Know_Us_By_the_Trail_of_Dead/The_Century_of_Self ->
../../../a/And_You_Will_Know_Us_By_the_Trail_of_Dead/The_Century_of_Self/
John_Coltrane/A_Love_Supreme -> ../../../a/John_Coltrane/A_Love_Supreme/
John_Coltrane/Giant_Steps -> ../../../b/John_Coltrane/Giant_Steps/
Tinariwen/Amassakoul -> ../../../b/Tinariwen/Amassakoul/
</div>
All dangling symlinks and empty directories (if any) under /srv/audio/ will get
removed. This script is idempotent.
<a name="another example"></a>
<h2>ANOTHER EXAMPLE</h2>
<div class="verbatim">
joostvb@hille:~% ls media/usb/audio/200504/Al_Green
The_Very_Best_Of/
joostvb@hille:~% ls media/usb/audio/
200504/ 200708/ 200801/ 200805/ 200807/ 200812/ 200910/ 201005/ 201009/
200609/ 200712/ 200803/ 200806/ 200808/ 200905/ 201004/ 201006/
joostvb@hille:~% cat .draai/symlinksrc.usb
DR_SL_SOURCE=~/media/audio
DR_SL_TARGETS="$( cd $DR_SL_SOURCE && ls -d ../usb/audio/* )"
joostvb@hille:~% DR_SL_RCFILE=.draai/symlinksrc.usb dr_symlinks
joostvb@hille:~% ls -l media/audio/Al_Green
total 0
lrwxrwxrwx 1 joostvb joostvb 48 2011-03-11 09:12 The_Very_Best_Of -> ../../usb/audio/200504/Al_Green/The_Very_Best_Of/
</div>
<a name="environment"></a>
<h2>ENVIRONMENT</h2>
dr_symlinks honors booleans: DR_SL_VERBOSE, DR_DEBUG and DR_DRYRUN and strings:
DR_SL_RCFILE, DR_SL_TARGETS and DR_SL_SOURCE.
<a name="files, configurarion"></a>
<h2>FILES, CONFIGURATION</h2>
All configuration variables (see ENVIRONMENT) can be set in
<tt>~/.draai/symlinksrc</tt>. This rc-file is sourced as a shell script.
If DR_SL_RCFILE is set, its value is assumed to be the dr_symlinks rc-file.
<a name="copyright and license"></a>
<h2>COPYRIGHT AND LICENSE</h2>
This manpage is copyright 2009, 2011 Joost van Baal-Ilić <joostvb-draai@mdcc.cx>.
Draai is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License, as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version. This program is distributed WITHOUT ANY WARRANTY. You should have
received a copy of the GNU General Public License along with draai. If not,
see <a class="extern" href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
<a name="author"></a>
<h2>AUTHOR</h2>
Joost van Baal-Ilić <joostvb-draai@mdcc.cx>
</body>
</html>
|