I'm new to org-mode and wrote a file with Babel in a few languages. I would like the file to each day, running the code in the org file, on a remote server - I don't think that's important.
I wanted to do it with cron. I was trying something like
crontab emacs -batch -l my_file.org
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.
It introduces an example using org-babel-tangle
, so you might want to replace org-babel-tangle
with your own function.
I have this in crontab:
emacs -batch -l ~/.emacs -eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt
This uses a custom agenda I already have set up (C-c a w
in orgmode) and exports to a text file. I then call that file via conky to display my agenda over my wallpaper.
Per the comments, you're going to want to do this via:
crontab -e
This opens up your crontab file to edit. Add the execution timeline (minute hour day-of-month month day-of-week) and the command you want to run (starting with emacs ...
) and you should be set. See the crontab man page for more details if you're not familiar).
Basically, figure out how to execute the org command successfully from the command line and then add it (prefixed with the columns telling cron when to run) via crontab -e
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With