Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Often when I run Duplicity I see an error message like this at the end of the run:

Cleanup of temporary file /home/user/.cache/duplicity/9a169830d41477b2dbc3c5b32edd4e8a/duplicity-MEXhMY-tempdir/mktemp-StAkzj-1 failed

The mentioned directory will contain ten or so files that are deleted the next time I run Duplicity.

Any idea why this sometimes fails when running incremental backups? I have not seen any pattern to it myself, and have had little luck in finding others mentioning the same issue. Some guy on some emailing list once mentioned that his locale caused problems for Duplicity. I tried changing from my normal Norwegian bokmål locale to en-US, but still see the issue.

Is this just normal operation for Duplicity?

Seeing it on three different systems: two Ubuntu 13.04 64-bit desktops and one Ubuntu Server 13.04 64-bit.

share|improve this question
I'm having this issue too since moving my duplicity cron job to be performed by root instead of a sudo user. I wonder if somehow duplicity doesn't have the ability to delete the temp files it creates while running a script croned from the root user? – Lonniebiz Nov 1 '13 at 20:27
I'm still hoping for an answer here. – Lonniebiz Jan 30 '14 at 21:31
Did you install GunPG ? I had the same issue (on OS X) until I've installed GPG tools. – Cédric Oct 14 '14 at 19:31

Properly configured Duplicity should not do that.

You might find these steps useful: Duplicity

I know you are on Ubuntu, but I cannot find any suitable source for you. It should be universal.

share|improve this answer

Maybe try modifying /usr/lib/python2.7/dist-packages/duplicity/tempdir.py (or wherever that file is at your system) to add a more specific exception handler, it seems to do just this:

                except Exception:
                    log.Info(_("Cleanup of temporary file %s failed") % util.ufn(file))

A more specific error handler added in front of that could try and show the more specific error number:

                except OSError as ex:
                    log.Info(_("Cleanup of temporary file %s failed with errno %d") % (util.ufn(file), ex.errno))

Running it under strace would show the errno of the unlink call, but would likely be slower and waste a lot of disk space for the log, esp. given the nature of what duplicity does.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.