Skip to content

restore

Sean Akahane-Bryen edited this page Jul 26, 2020 · 4 revisions

Restore a backup

restore.kmmacros

Restores a specified backup of the notes directory.

The macro uses Keyboard Maestro's "Trash File" action to move the current notes directory to the trash, rather than rm to delete it.

Invoked Shell Script

# First, take a backup.
cp -a "${KMVAR_Instance_Notes_Directory%/}" "$KMVAR_Instance_Backup_Directory/$(date "+%Y-%m-%d, %H.%M") - Before Backup Restoration"
# Restore the chosen backup.
cp -a "${KMVAR_Instance_Backup_to_Restore%/}" "${KMVAR_Instance_Notes_Directory%/}"

# Fetch the folder name for the success notification.
echo "${KMVAR_Instance_Backup_to_Restore##*/}"

Changelog

Version Date Changes
1.00 2020-07-26 Initial commit
Clone this wiki locally