dr_symlinks(1)
π« dr_symlinks(1) β USER COMMANDS π«
okay bestie, welcome to the manual page for dr_symlinks, living in section 1 of your friendly neighborhood user commands π
β¨ NAME β¨
dr_symlinks β maintain a symlink forest π²
π¦ SYNOPSIS π¦
dr_symlinks
πΈ DESCRIPTION πΈ
okay so here's the tea β: for every pair of directory/subdirectory under every word in DR_SL_TARGETS, a directory plus a symlink at DR_SL_SOURCE/directory/symlink gets created (or adjusted, if it's already vibing there). π
ngl, the script is literally just a wrapper around oggsymlinks, by Wessel Dankers. iconic behavior, we love to see it π
π₯ EXAMPLE π₯
so imagine: in the config file $HOME/.draai/symlinksrc, DR_SL_SOURCE is set to /srv/audio and DR_SL_TARGETS is set to "../data/a ../data/b", and meanwhile these directories exist:
/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/
then these directories holding these symlinks are gonna get created in /srv/audio/:
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/
and heads up π«Ά β all dangling symlinks and empty directories (if there are any) under /srv/audio/ are gonna get removed. this script is idempotent, which is just a fancy way of saying it's got main character energy and doesn't spiral when you run it twice π
β¨
π ANOTHER EXAMPLE π
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/
ate. no crumbs. π
π ENVIRONMENT π
dr_symlinks honors some booleans and some strings, bestie:
- booleans:
DR_SL_VERBOSE,DR_DEBUGandDR_DRYRUN - strings:
DR_SL_RCFILE,DR_SL_TARGETSandDR_SL_SOURCE
π FILES, CONFIGURATION π
all the configuration variables (peep the ENVIRONMENT section above π) can be set in ~/.draai/symlinksrc. this rc-file gets sourced as a shell script, fr fr.
and if DR_SL_RCFILE is set, its value is assumed to be the dr_symlinks rc-file. that's the whole vibe check.
π COPYRIGHT AND LICENSE π
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 http://www.gnu.org/licenses/.
π AUTHOR π
Joost van Baal-IliΔ <joostvb-draai@mdcc.cx>
and that's the whole page, bestie π«Ά this was dr_symlinks version 20201215, dated 15 Π΄Π΅Ρ 2020, and honestly? she ate. π
β¨π
π¦ where this page comes from
- debian bookworm: draai 20201215-2
- ubuntu jammy: draai 20201215-2
- ubuntu noble: draai 20201215-2
- Copyright (c) 2020 Joost van Baal-IliΔ <joostvb-draai@mdcc\&.cx>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms