0

My emacs org-mode agenda files are steadily growing, and many of my projects span several to many years. In addition, I need to last access the entries after about a year. Hence rather than (or in addition to) archiving my agenda entries per project, I would like to archive all my agenda entries from a given date range, for example (half) a calendar year. Is this possible somehow? Since I need to do this once or twice a year, it isn't too bad if I need more than a few keystrokes for this action (which I could stick in a macro anyway). Even if the solution would only work for a given month or calendar year, rather than any random date range, it would help me.

My work agenda file has a structure like below. I would like that structure to be kept in the archive file, in case I ever need to figure out how much time I spent on a given project or on all my teaching years later.

* Research
** Project 1
*** Task 1 (with timestamp below)
<2023-07-19 Wed 11:40>
*** Task 2
<2023-07-19 Wed 11:41>
*** Etc
** Project 2
*** More tasks with timestamps
** Project N
* Teaching
** Class 1
*** Even more tasks with timestamps
** Class 2
*** More tasks with timestamps
6
  • 2
    How about conducting a search for a specific date range, then mark the ones within that search result that you want to archive (or all of them), and then archive them? Here is a link to some advanced searching techniques from the manual: orgmode.org/worg/org-tutorials/advanced-searching.html See also the agenda individual / bulk marking commands in the manual: orgmode.org/manual/Agenda-Commands.html
    – lawlist
    Oct 3, 2020 at 15:32
  • @lawlist That looks pretty powerful. However, I was hoping to keep the structure from the original file in my archive file. I hadn't realised sufficiently how essential that is to my wishes and hadn't specified it in the question, so I just added it.
    – AstroFloyd
    Oct 23, 2020 at 19:40
  • How do you store the dates (that is to say, how could I know that an entry is eligible for this archiving?
    – Trevoke
    Jul 15, 2023 at 21:40
  • @Trevoke Orgmode agenda uses timestamps formatted like <2023-07-19 Wed 11:40>.
    – AstroFloyd
    Jul 19, 2023 at 10:09
  • @AstroFloyd what I mean is, where is the timestamp? a property? the body?
    – Trevoke
    Jul 19, 2023 at 11:12

1 Answer 1

0

I created a command-line tool written in Python called org-agenda-archive that (crudely) does what I wanted and published it on GitHub.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.