I want to backup a shared directory with lots of smalls files, which are constantly changed by my users (add/delete/edit). As usual, I use
tar and filter the content through a compression program like
Let's call the files after the operation begins as "old files", and the files being added/deleted by my users as "new files". I am fine with old and new files being mixed, but backing up a file with half of its binary being old and the other half being new is totally unacceptable. I've read the answers from this question and found that using
tar is not safe at all.
Is it safe if I copy that directory to temporary location first using
cp -r command? And if it is not, do I have any other options? Using LVM volume snapshot is not an option for me, because I am using a single 2TB portable drive plugged into an OpenWrt router's USB port, where I use
samba to share it. Besides, I also want to keep the backup as small as possible, so that I can upload it to another file server.