Backup linked files HOWTO

I’m reinstalling MacOS for a fresh start and using Opencore patcher to install Ventura. I want to find any files I left in my Downloads directory and back them up before I wipe everything.

Here’s how to do that:

  1. Install the 3rd party hook CLI:
sudo gem install hookapp
  1. list all hook files referencing the directory you want to get hooked files out of. Notice that for me I’m only chosing the Downloads dir:
    hook ls |grep Downloads > hooked_files.txt

  2. Read the hooked_files.txt file to make sure it’s OK. Then copy hooked_files.txt to backup to your current dir

  3. Backup all those files to your current directory:

#!/bin/bash

destination="./"

while IFS= read -r file; do
    rsync -a --progress "$file" "$destination"
done < hooked_files.txt
2 Likes