V
V
Valeriy Solovyov2014-09-04 13:35:47
linux
Valeriy Solovyov, 2014-09-04 13:35:47

How to quickly compare files in Linux, get a delta and then rollback/restore changes using it?

Good afternoon
There is a base folder (template) that is copied to the server, it changes there.
You need to quickly find the delta between the base folder and the current one. Having the base folder (template) everywhere and downloading the delta restore the current state.
git/svn/cvs are not suitable
If possible, all updated files and folders are stored in a specific one that can be archived immediately. The list of files to be deleted is output/saved to a file.
If not:
After running rsync, I can see what files are updated/deleted in the second folder.
But I don't need any skipping non-regular file "dev/ptya7".
It seems to be "it works" for the second option, but how to make the first option?:

[email protected]:~# mkdir DST SRC
[email protected]:~# mkdir DST/1 DST/2 SRC/3 SRC4
[email protected]:~# echo "test" >DST/test
[email protected]:~# echo "test" >SRC/test2
[email protected]:~# touch DST/1/dddddd
[email protected]:~# rsync --dry-run --recursive --del -v -l -c  SRC/ DST
Но по прежнему это медленно если делать первый запуск:
time rsync --dry-run --recursive --del -v -l -c  20/ 130

sent 1172310 bytes  received 5382 bytes  22867.81 bytes/sec
total size is 838851722  speedup is 712.28 (DRY RUN)

real    0m50.912s
user    0m2.688s
sys     0m7.784s

The second launch is more cheerful:
sent 1172347 bytes  received 5385 bytes  261718.22 bytes/sec
total size is 838851722  speedup is 712.26 (DRY RUN)

real    0m4.384s
user    0m3.268s
sys     0m1.732s

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mx2000, 2014-09-04
@mx2000

docker can do all of the above.

V
Valeriy Solovyov, 2014-09-18
@sumej

Found the answer: overlayfs, but it has one problem - nested mount support

O
O Di, 2015-01-27
@insiki

Maybe you should look at ZFS?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question