copy only new files

To make a differential copy, so you copy all files in /a that are not in /b, you can do:
# cd /a
#/usr/local/bin/tar pcf – kraftek.html POSTS rescue rescued.html rescued.txt x y z | ( cd /b; /usr/local/bin/tar kxfp – )
The clue here is the “k” option, to keep existing files
compare directories for missing files
So you made a copy of /a into /b, but you see /b has less files, how to know which files are missing in /b x y z
# find /a | sort > as.txt
# find /b | sort > bs.txt
# comm -23 as.txt bs.txt
the last command will show the files that are in /a that are not in /b
enjoy
192/433

Leave a Reply

Your email address will not be published. Required fields are marked *