what happens with .~tmp~ after an interruption?

Wayne Davison wayned at samba.org
Sat Jul 4 16:22:37 GMT 2009


On Fri, Jul 03, 2009 at 05:25:18PM -0300, Carlos Carvalho wrote:
> What happens if [some of] these files no longer exist in the source
> when the next run happens? Are they, and .~tmp~, removed or kept?

The file is only removed if a matching filename is transfered in the
parent directory.  This is because rsync doesn't know if the file was
left by some other rsync that is going to still need it, or if it should
clean it up.  It might be nice to have rsync remove any files with a
ctime older than a certain span of time, but that is not currently done.

If your rsync runs are leaving .~tmp~ dirs lying around, you can either
schedule your own aging of files in .~tmp~ dirs (e.g. via find), or use
some custom rsync command that will only remove a .~tmp~ dir and its
contents from a remote directory (e.g. via include/exclude rules).

An example find command:

find . -path '*/.~tmp~/*' -cmin 240 -delete

That's leaves rsync to cleanup the empty dirs.  You could use a more
complex command to clean those too:

find . -depth -path '*/.~tmp~/*' -cmin 240 -delete -o -name '.~tmp~' -cmin 240 -delete

..wayne..


More information about the rsync mailing list