LINKTODIRS(1)

πŸ“¦
version 3.5.2 Β· 2 versions
, in ubuntu stonking

πŸ’– linkToDirs.pl β€” LINKTODIRS(1) πŸ’–

okay bestie, sit down, hydrate, and let me tell you about linkToDirs.pl β€” a Perl script that hard links files in directories with others. she's giving storage-saving icon behavior and honestly? we're obsessed. πŸ’…


✨ SYNOPSIS ✨

linkToDirs.pl [--linkWith copyBackupDir] [--linkWith ...]
              --targetDir targetForSourceDir
              [--progressReport number[,timeframe]]
               [--printDepth] [--dontLinkSymlinks]
              [--ignoreErrors] [--saveRAM] [-T tmpdir]
              [--createSparseFiles [--blockSize]]
              [--maxHardLinks]
sourceDir ...

no cap, that's the whole vibe right there. πŸ‘‘


🌸 DESCRIPTION 🌸

so what she does is: make a de-duplicated copy of files in one directory to another location. she utilizes hard links to the full extent possible to avoid wasting storage space. like, ALL the extent. she is not leaving a single hard link on the table, periodt. ✨

usage note, and this is the tea πŸ“: whereas many file copy utilities have just two primary parameters (the source and the destination), linkToDirs.pl allows three primary parameters:

  • source (sourceDir)
  • destination (targetDir)
  • and a reference location (linkWith, optional) πŸŽ€

the reference location is the place to look for existing content which can be hard linked to. files with the same contents in sourceDir are hard linked always in targetDir. literally always. no exceptions, no take-backs, main character energy only. πŸ’–


πŸ’… OPTIONS πŸ’…

  • --linkWith, -w β€” linkWith target; the backups where other backups have to be linked to πŸ’« use this parameter multiple times for multiple directories. and bestie, if you do not use this option, the program will just copy and link sourceDir.
  • --targetDir, -t β€” path(s) to directory where backups specified by --sourceDir should be placed πŸŽ€
  • --progressReport, -P β€” print a progress report after each number files πŸ“Š additional you may add a time frame after which a message is printed. if you want to print a report each 1000 files and after one minute and 10 seconds, use: -P 1000,1m10s β€” cute, right?? πŸ¦‹
  • --printDepth, -D β€” print depth of actual read directory during backup πŸ”
  • --dontLinkSymlinks β€” do not hard link identical symbolic links πŸ™ˆ
  • --ignoreErrors, -i β€” if set, don't stop in case of errors when copying 🫢 (yes she'll just keep going, she's resilient like that)
  • --saveRAM β€” write temporary dbm files in --tmpdir πŸ’Ύ use this if you do not have enough RAM
  • --tmpdir, -T β€” directory for temporary files, default is </tmp> πŸ“
  • --createSparseFiles, -s β€” if a file is indicated as a sparse file and that file has to be copied, then external program cp is called to copy that file 🧚 (gnucp / linux does some inspection about sparse files, if your OS related version of cp does not support this functionality, then this option will not work for you β€” read that again bestie, it's conditional)
  • --blockSize β€” block size used to check if a file is / may be a sparse file πŸ“ default is 512 bytes (which should be fine for most file systems)
  • sourceDir β€” path(s) to directories which have to be linked to other backups πŸ’œ use this parameter multiple times for multiple directories
  • --maxHardLinks β€” maximum number of hard links to use πŸ”— zero (0, the default) means the limit depends on the file system used only

Copyright (c) 2012-2022 by Heinz-Josef Claes (see README). Published under the GNU General Public License v3 or any later version. πŸ’–


and that's the whole page, bestie β€” perl v5.40.1, dated 2026-05-23, from the LINKTODIRS(1) of it all. go forth and link responsibly. mwah. πŸ’‹βœ¨πŸ‘‘

πŸ“¦ where this page comes from