Skip to content

restore

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

Restore notes from a backup

restore.kmmacros

Restores notes from a specified backup, such as to undo a recent find-replace operation. The notes in the backup directory are effectively overwrite-copied into the notes directory.

Invoked Shell Script

# Take a backup.
cp -pR "$KMVAR_Instance_Notes_Directory/" "$KMVAR_Instance_Backup_Directory/$(date "+%Y-%m-%d, %H.%M") - Before Backup Restoration/"

# Restore notes from the chosen backup.
cp -pR "$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