From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Handling errors in command line exporting of agenda? Date: Fri, 5 Aug 2011 17:15:22 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpSft-0000QN-Ds for emacs-orgmode@gnu.org; Fri, 05 Aug 2011 18:15:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QpSfs-0006eZ-7s for emacs-orgmode@gnu.org; Fri, 05 Aug 2011 18:15:25 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:52596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpSfs-0006eS-3Q for emacs-orgmode@gnu.org; Fri, 05 Aug 2011 18:15:24 -0400 Received: by fxg9 with SMTP id 9so2320429fxg.0 for ; Fri, 05 Aug 2011 15:15:22 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode I have a custom view that I'm exporting to a text file and then displaying on my wallpaper with conky. I noticed that if I actually have emacs open and a file is autosaved but not saved "for real," then the exported text file is blank. I use this command in cron: ,--- | emacs -batch -l ~/.emacs -eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt `--- I ran this from the command line after noticing the cron job was coming up empty, and saw the error: ,--- | ...file.org locked by jwhendy... (pid 27250): (s, q, p, ?)? `--- If I saved the offending file, it re-ran fine. As soon as enough time elapsed to generate an auto-save (I'm assuming), it failed again. Any suggestions on how to proceed? For example, I though of: 1) writing a script that could handle the failure and leave the current agenda exported text file if it happened 2) a way to respond to the emacs query (not sure what s, p, q, ? do) Anything else that would work? If it's frozen and "not safe" to run this command while a file is open/being modified, then just aborting and leaving the status quot in the text file is what I'd like to do. Thanks! John