From: Tim R. <ti...@ph...> - 2011-05-19 16:01:16
|
On 5/19/2011 4:02 AM, Nikolaus Schulz wrote: > On Tue, May 17, 2011 at 11:08:40PM +0700, Tim Rice wrote: >> On 5/17/2011 10:10 PM, Malahal Naineni wrote: >>> Tim Rice [ti...@ph...] wrote: >>>> 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. > > That looks like a good guess to me. > >>> 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. > > Changing code isn't necessary, the verbose command line switch -v also > reveals this. > > Nikolaus Yes, this was the problem, tracked down two rouge archivemail files in the tmp folder and deleted them. All is working perfectly now. Thanks for everyone's help on this, I would never have figured this out without this forum. -- Best Regards, Tim Rice Computer Stuff Phuket Thailand 83000 Tel: +66 76 376165 Fax: +66 76 376165 www.computerstuff.net www.phuket-mail.com |