Making tmpfile_prefix configurable

2011-07-04
2013-02-19
  • Simon Schøbel
    Simon Schøbel
    2011-07-04

    Hi,

    we're making a daily dump of our database, and storing it encrypted on s3 (s3cmd put -encrypt), however since the dump is becoming quite large >80% of /tmp, the encryption fails, since it relies on a temporary file made up by Utils.mktmpfile() which will make a filename that has the following prefix: /tmp/tmpfile-

    I would like to be able to configure the prefix being used, since my ~ partiton has more than enough space to do this.

    The suggested patches:

    S3/Config.py
    15a16
    >   tmpfile_prefix = "/tmp/tmpfile-"
    s3cmd
    1203c1203
    <   tmp_filename = Utils.mktmpfile()
    ---
    >   tmp_filename = Utils.mktmpfile(cfg.tmpfile_prefix)
    1304c1304
    <                       filename = Utils.mktmpfile()
    ---
    >                       filename = Utils.mktmpfile(cfg.tmpfile_prefix)