Emacs: batch process org files through crontab

I am new to org-mode and wrote a file with Babel in several languages. I need a file every day, running the code in the org file, on a remote server - I do not think this is important.

I wanted to do this with cron. I tried something like

crontab emacs -batch -l my_file.org

+6
source share
2 answers

Section 14.12 of the Org manual will be a good entry point for batch execution. Its online version can be found at http://orgmode.org/manual/Batch-execution.html . He introduces an example using org-babel-tangle , so you can replace org-babel-tangle your own function.

+2
source

I have this in crontab:

 emacs -batch -l ~/.emacs -eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt 

This uses a custom program that I have already configured ( Cc aw in orgmode) and export to a text file. Then I call this file via conky to display my agenda on top of my wallpaper.

Have you decided to solve it?

In the comments, you will want to do this via:

 crontab -e 

This opens your crontab file for editing. Add the execution timeline (minute day of the month month of the month to week) and the command you want to run (starting with emacs ... ), and you should be installed. See the crontab man page for more information if you are not familiar).

Basically, figure out how to successfully execute the org command from the command line, and then add it (with the prefix of the columns telling cron at startup) via crontab -e .

+2
source

Source: https://habr.com/ru/post/910542/


All Articles