How to Use KBM to Back Up a New Instance of the Folder Weekly?

Basically I have a folder named "folder" that I back up weekly - it's content is changing from week to week.

I want to back this "folder" into a "backup" folder with a new name folder+date each week, rather than one backup on top of each other.

I also want to keep say 30 copies of these backup folders, and as the backup 31 is created, backup 1 should be deleted (the oldest).

How to use KBM to back up a new instance of the folder weekly?

1 Like

Hey Boris,

Here's the basics.

Back Up a Folder With a Date-Stamp v1.00.kmmacros (5.9 KB)
Keyboard Maestro Export

This is pretty simple once you understand the pieces of the puzzle.

It's less simple to count the number of folders and delete the oldest one.

I'll come back to that if I have time.



This is fantastic, thank you so much!
I’ve never used split path before - will need to look closely at its function.

Much appreciated,

Here's my approach to rolling off aging backups where I am keeping 3 backups - this probably gets a little unwieldy if you want to keep 30, but thought I'd put it out there because it is really just duplicating a bunch of actions and then adjusting the numbers:

Backup Hazel Rules Macro (v9.2)

Backup Hazel Rules.kmmacros (3.2 KB)

Thank you Rob.

Interesting solution - you basically have one most recent and two previous copies at all times.

Yes, my approach exactly. For your specific request, another approach might be to take the folder where your dated backups are stored, and do:

  1. For each dated folder, get creation date to a variable,
  2. compare variable to a date 30 weeks ago, and
  3. if date variable is greater than 30 weeks old (or however many weeks backups you are keeping), delete that dated folder.

Makes sense, thank you for your help!