Rsync create new file on file size change
I need to backup (for debugging) some temporary files meanwhile a program running. I used to do it with rsync
-ing the /var/tmp/someprogram
directory with find . -iname 'blahblah' -exec rsync -someoptions $DESTdir
, which works wonderful.
Except the case of someone in some program (for which I don't have source code access, and never will have - sad, and long story starting with COBOL...) overwrites the temporary file with new content from within the some program.
E.g.
- Starting
PROG
program - This creates a
B1237
file in thetmp
dir (and I'mrsync
ing in every few minutes) - After the PROG finishes the processing of B123 it starts another cycle and recreates
B1237
with new content, and thersync
-ed file will be overwritten. And I need the first version as well.
Is it possible in an easy way? I was thinking about timestapped gzipping of the DEST dir, but there should b开发者_运维技巧e another way (without creating a (e.g.) git
repo in the dest dir, and commiting after syncing...
Update: I did not mention - sorry - that I don't have the rights to install anything on this SLES9 (corporate) server.
Thanks in advance!
In case you want to do something more space-efficient than cp --archive
, you might want to look at faubackup
.
精彩评论