Suppose I have an archive/ folder, which contains several .org_archive files, each for a specific month.

When I archive a task in org-mode, is there a way to make it so that the task is automatically archived to the appropriate archive file, based on the current month?

For example, if I complete a task on 07/31/2016, archiving the task should move it to archive/archive-201607.org_archive. The next day, on 08/01/2016, archiving another task should move it to archive/archive-201608.org_archive. If the appropriate file for the month doesn't exist, org-mode should create one.

1 Answer 1


Try setting org-archive-location as:

(setq org-archive-location (concat "archive/archive-"
                                   (format-time-string "%Y%m" (current-time))
  • 1
    This can only work if I restart Emacs at the beginning of each month.
    – antonio
    Commented Jul 19, 2020 at 22:26

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.