From: Malahal N. <ma...@us...> - 2011-05-17 15:11:00
|
Tim Rice [ti...@ph...] wrote: > Hi All, > > I get the following errors when running under crontab. If I run from > the command line I don't get any errors. > > Any idea why Cran is breaking this? > > Traceback (most recent call last): > File "/usr/local/bin/archivemail", line 1604, in <module> > main() > File "/usr/local/bin/archivemail", line 703, in main > archive(mailbox_path) > File "/usr/local/bin/archivemail", line 1149, in archive > _archive_mbox(mailbox_name, final_archive_name) > File "/usr/local/bin/archivemail", line 1220, in _archive_mbox > retain.write(msg) > File "/usr/local/bin/archivemail", line 384, in write > self.mbox_file.write(body) > IOError: [Errno 28] No space left on device Just looked at the code. The archivemail creates a temporary file using tempfile.mkstemp("retain"). "dir" is not specified, so a default directory is used. The default directory is chosen from a platform-dependent list, but the user of the application can control the directory location by setting the TMPDIR, TEMP or TMP environment variables. So it boils down to the difference of environment variables setting of TMPDIR, TEMP or TMP under those two execution environments (cron vs direct). If you are comfortable with python, you can just log 'temp_name' in RetainMbox class just after this "temp_name = tempfile.mkstemp("retain")[1]" and see what it is under those two different execution environments. Hope that helps! Malahal. |