Skip to content

Instantly share code, notes, and snippets.

@gingerbeardman
Last active August 21, 2020 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gingerbeardman/f099e3136e359ae075479ed2b10199ef to your computer and use it in GitHub Desktop.
Save gingerbeardman/f099e3136e359ae075479ed2b10199ef to your computer and use it in GitHub Desktop.
Extract all versions of a file/folder from Time Machine backup
# adapted from https://apple.stackexchange.com/questions/230154/getting-all-versions-of-a-file-from-a-time-machine-backup/230392#230392
TARGET="/Volumes/External/Users/matt/Projects/TMextract/all_my_versions"
# create new folder
mkdir $TARGET
# change directory to your backups
cd /Volumes/Tardis/Backups.backupdb/matt
pwd
# run for loop to copy all folders into newly created directory
for F in *
do
echo $F
rsync --exclude={'_Old','*.zip'} -avz --no-perms --no-group --no-owner "$F/External/Users/matt/Projects/Alpha" $TARGET/$F
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment