Skip to content

Instantly share code, notes, and snippets.

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 backslash112/e54ab6a8144786ab5902745247e23d99 to your computer and use it in GitHub Desktop.
Save backslash112/e54ab6a8144786ab5902745247e23d99 to your computer and use it in GitHub Desktop.
Time machine on JuiceFS
JFS_BASE=/Users/yujunz/JuiceFS
JFS_NAME=rogerz-s3-cn-east-1-qiniu
BUNDLE=TimeMachine.sparsebundle
VOLUME=/Volumes/TimeMachine

# Mount JuiceFS
juicefs mount --cache-dir $JUICEFS_BASE/cache --batch 10 --writeback --metacache --opencache $JFS_NAME $JFS_BASE/$JFS_NAME

# Create sparse bundle
hdiutil create -size 600g -type SPARSEBUNDLE -fs "HFS+J" $BUNDLE
mv $BUNDLE $JFS_BASE/$JFS_NAME

# Attach and set as time machine destination
hdiutil attach -mountpoint $VOLUME $JFS/$BUNDLE
sudo tmutil setdestination -a $VOLUME

Force umount

➜  JuiceFS umount rogerz-s3-cn-east-1-qiniu
umount(/Users/yujunz/JuiceFS/rogerz-s3-cn-east-1-qiniu): Resource busy -- try 'diskutil unmount'
➜  JuiceFS diskutil umount rogerz-s3-cn-east-1-qiniu
Unmount failed for rogerz-s3-cn-east-1-qiniu
➜  JuiceFS umount -f rogerz-s3-cn-east-1-qiniu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment