I have a directory with 1000 something video files that are backed up on an external drive. The content of a video file doesn't change.
So I need a syncing tool that follows the following rule.
If a file doesn't exist in backup, create it.
If a file exist in backup, but not original, delete it, or ideally ask me what to do.
If a file exists in both original and backup, check if the file name and size are the same, if yes, ignore it. If not, overwrite it or ideally ask me. Bonus if it also checks the first KB of the backup file to ensure it's not truncated by zeroes.
rsync
, most easy available on Linux systems. Fits 1 100%, the first half of 2 is easy (--delete
parameter), and the first half of 3 as well.rsync --delete -Pa <src> <target>
("P" stands for "show progress", which is good for testing; "a" is a combination of flags meaning "archive", i.e. keep all attributes, time stamps etc). Depending on your structure, "src" should end with a/
(meaning, all inside it) but target not – that might require some playing with, hard to describe. In the worst case, it copies the source directory inside target. Always fist try with something you can afford to loose, until you get a feeling for it ;)