Automating selective folder back-up using Automator

I recently posted a question about automating the back-up of selected folders to an external drive. I believe I know how I want to do it and have all my criteria met.


Does anyone have advice on using the Automator to set this up? My question, briefly, is that I have three large (currently 1.5 tb) folders that I want to back up to an external drive, and have them update automatically. I need this as a local back-up, use the iCloud for other things, and have other Time Machines for other purposes. These have to be handled separately. Thank you.

iMac 27″, macOS 10.13

Posted on Jan 12, 2023 6:39 AM

Reply
Question marked as Top-ranking reply

Posted on Jan 12, 2023 9:01 AM

For the stated goals of writing a custom local backup, I'd use a bash or zsh shell script and launchd, or would use periodic. Among other uses, I've a script summoned by periodic for a similar task; for some database backups that Time Machine can't otherwise get a reliable backup of.


You will be using cp and rm commands, here. Also handling deleting the older backups, and that deletion preferably after the new backups are created. (Coincidentally, I posted a zsh script here that fetches the dates from files and uses that as the filename a day or so ago.) I'm certain there are example backup scripts posted around, but have not gone looking for those.


Treat rm with great care.


Double-quote all file specifications, as spaces are likely.


Building the launchd plist can be a little involved, and the Lingon app can help there.


For info on periodic, see man periodic.


Launchd is more flexible, while periodic is brute-force and tends not to be all that great about error feedback.


Or if you'd prefer to avoid getting into the supporting-a-backup-script business, the Carbon Copy Cloner app is just gonzo flexible.


TL;DR: I'd seriously consider the use CCC here, as backups will have "corner cases"; some errors are to be expected. Errors that can arise here will include full backup devices, offline backup devices, problems with the source files, failures of the cleanup, etc.

Similar questions

1 reply
Question marked as Top-ranking reply

Jan 12, 2023 9:01 AM in response to Cynthia_Boston

For the stated goals of writing a custom local backup, I'd use a bash or zsh shell script and launchd, or would use periodic. Among other uses, I've a script summoned by periodic for a similar task; for some database backups that Time Machine can't otherwise get a reliable backup of.


You will be using cp and rm commands, here. Also handling deleting the older backups, and that deletion preferably after the new backups are created. (Coincidentally, I posted a zsh script here that fetches the dates from files and uses that as the filename a day or so ago.) I'm certain there are example backup scripts posted around, but have not gone looking for those.


Treat rm with great care.


Double-quote all file specifications, as spaces are likely.


Building the launchd plist can be a little involved, and the Lingon app can help there.


For info on periodic, see man periodic.


Launchd is more flexible, while periodic is brute-force and tends not to be all that great about error feedback.


Or if you'd prefer to avoid getting into the supporting-a-backup-script business, the Carbon Copy Cloner app is just gonzo flexible.


TL;DR: I'd seriously consider the use CCC here, as backups will have "corner cases"; some errors are to be expected. Errors that can arise here will include full backup devices, offline backup devices, problems with the source files, failures of the cleanup, etc.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Automating selective folder back-up using Automator

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.