Previous: Setting Options, Up: Custom agenda views


8.6.4 Creating agenda views in batch processing

If you want to print or otherwise reprocess agenda views, it can be useful to create an agenda from the command line. This is the purpose of the function org-batch-agenda. It takes as a parameter one of the strings that are the keys in org-agenda-custom-commands. For example, to directly print the current TODO list, you could use

     emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr

You may also modify parameters on the fly like this:

     emacs -batch -l ~/.emacs                                      \
        -eval '(org-batch-agenda "a"                               \
                 org-agenda-ndays 300                              \
                 org-agenda-include-diary nil                      \
                 org-agenda-files (quote ("~/org/project.org")))'  \
        | lpr

which will produce a 300 day agenda, fully restricted to the Org file ~/org/projects.org, not even including the diary.