|
NAMEsamechflags change file flagssamechmod change file modes samechown change file owner and group samecp copies the first file of a pair of duplicate files samedelay delays line output until the files are no longer in use sameln links duplicate files together samemv moves the first file of a pair of duplicate files samerm remove the last of a pair of duplicate files SYNOPSISsamechflags [-g size] [-m size] [-S sep] [-dHmqVvw] flagssamechmod [-g size] [-m size] [-S sep] [-dHmqVvw] mode samechown [-g size] [-m size] [-S sep] [-dHmqVvw] owner[:group] samecp [-A | -At | -L | -Z | -Zt] [-g size] [-m size] [-o filename | -p command] [-S sep] [-HlmsqVvw] destination [source] samedelay [-S sep] [-HqVv] sameln [-A | -At | -L | -Z | -Zt] [-g size] [-m size] [-o filename | -p command] [-S sep] [-HmsqVvw] samemv [-A | -At | -L | -Z | -Zt] [-g size] [-m size] [-o filename | -p command] [-S sep] [-HmqVvw] destination [source] samerm [-A | -At | -L | -Z | -Zt] [-g size] [-m size] [-o filename | -p command] [-S sep] [-HmqVvw] DESCRIPTIONThese programs reads the samefile output (indicating two files have identical contence) from stdin and perform some action. The naming convention is as follows: all prorams start with the prefix this doesn't exist, a discriptive name.Some programs, like sameln, create a temporary backup in order to prevent the loss of data. As of version 1.9 they use the postfix the path with '.programname.numer' (i.e. .sameln.0). Earlier versions used might be wise to backup your data. On FreeBSD 7.1 or newer you could make a backup using the following command: cp -Rpl sources backup-dir/ And later you can use rsync to sync the files. rsync -aHW backup-dir/sources . OPTIONS
EXAMPLESLink all duplicate files in the current working directory:% ls | samefile -i | sameln Link all duplicate files in my HOME directory and subdirectories and also tell me if there are hard links: % find $HOME -type f -size +0 | samefile -i | sameln Remove all duplicate files in my HOME directory and subdirectory % find $HOME -type f -size +0 | samefile -ir | samerm Link all duplicate files in the /usr directory tree that are bigger than 10000 bytes and write filename pares that coudn't be processed to /tmp/usr. (that one is for the sysadmin folks, you may want to 'amp' - put it in the background with the ampersand & - this command because it takes a few minutes.) % find /usr -type f -size +0 | samefile -g 10000 | sameln > /tmp/usr Link all duplicate files in reverse order, but first changes the file flags of the files and there parent directories and later set them. % find /path/to/backups -type f -size +0 | samefile -iZ | \ chflags -d noschg | chflags noschg | sameln -Zp "samedelay | \ chflags -d schg | chflags schg > /dev/null" | samedelay | \ chflags -d schg | chflags % schg DIAGNOSTICS<number>... This amount of lines processed so far.failed to create the backup path This is probably due to a 'permission denied' error on files or directories within the given path for which you have no read permission. This error is given in order to prevent the loss of files. failed to remove path This is probably due to a 'permission denied' error on files or directories within the given path for which you have no read permission. failed to link path -> path This is probably due to a 'permission denied' error on files or directories within the given path for which you have no read permission. Before version 1.1 this owuld mean you would have lost a file, but from version 1.2 a backup file is created. failed to delete the backup path This is probably due to a 'permission denied' error on files or directories within the given path for which you have no read permission. The relink of the original files was succesfull, but you do need to clean up the backup manually. free vnodes droped below threshold This is normal. The program goes to sleep in order to alleviate stress on the system until the amount of free vnodes has risen above the threshold. The first this happend you may want to check top for any processes in the 'vlruwk' state. If this is then you might like to read BUGS section. BUGSYour computer may become so slow that it may appear to frees. This is not a bug but is caused because the operating system is running out of resources. If you're on a FreeBSD you might 'cure' this by raising the kern.maxvnodes by 10 000. Other solutions incluse removing the option -w so the process will spend more time on one file or pipe the program to samefile instead of reading from a large file.SEE ALSOsamefile(1) samesame(1) chflags(1) chmod(1) chown(1) ln(1) rm(1) df(1) sysctl(8)AUTHORAlex de Kruijff
Visit the GSP FreeBSD Man Page Interface. |