Scroll to navigation

LINKTODIRS(1) User Contributed Perl Documentation LINKTODIRS(1)

NAME

linkToDirs.pl - hard links files in directories with others

SYNOPSIS

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

DESCRIPTION

Make a de-duplicated copy of files in one directory to another location. Utilizes hard links to the full extent possible to avoid wasting storage space.

Usage note: whereas many file copy utilities have just two primary parameters (the source and 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.

OPTIONS

    linkWith target; the backups where other backups have to be
    linked to use this parameter multiple times for multiple
    directories
    if you do not use this option, the program will just copy and
    link 'sourceDir'
    
    path(s) to directory where backups specified by
    --sourceDir should be placed
    
    print 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
    
    print depth of actual read directory during backup
    
    do not hard link identical symbolic links
    
    if set, don't stop in case of errors when copying
    
    write temporary dbm files in --tmpdir
    use this if you do not have enough RAM
    
    directory for temporary files, default is </tmp>
    
    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)
    
    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)
    
    path(s) to directories which have to be linked to other backups
    use this parameter multiple times for multiple directories
    
    maximum number of hard links to use
    zero (default) means limit depends on file system used only
    

COPYRIGHT

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

2022-03-20 perl v5.34.0