Alvin Liu

  • Home
  • About
  • Privacy Policy
  1. Main page
  2. Misc
  3. Main content

Backup your Mac without time machine

2023-05-31 1484hotness 0likes 0comments

Time machine is a powerful tool to protect all files on Mac, but maybe sometime you only need a simple alternative way.

Here I want to share a way to use build-in rsync command backup a folder to antoher place.

You only need one command line:

rsync -av --delete --exclude='~$*' /Users/alvin/work/ /Users/alvin/bak/

Here work/AU is source folder and bak is target folder. They are on different hard disk.

Let me explain some parameters:

-a copy files with original create time and attributes.

-v show detail progress

--delete remove files not at source folder

--exclude skip backup some files

-c compare files to optimize network transmission. I do not need it since I only copy it at local.

You can use build-in crontab command to schedule it, for example I want it run every 4 hours. Use crontab -e to configure crontab job, input following configuration and press escape and input :wq enter to save changes.

0 */4 * * * /usr/bin/rsync -av --delete --exclude='~$*' /Users/alvin/work/ /Users/alvin/bak/

If you want to backup to iCloud Drive, please use the following folder:

/Users/alvin/Library/Mobile\ Documents/com~apple~CloudDocs

相关文章

  • Android 13 bypass Restricted Setting without root

This article is licensed with Creative Commons Attribution-NonCommercial-No Derivatives 4.0 International License
Tag: Nothing
Last updated:2024-02-19

Alvin Liu

Software Developer in Toronto

Like
Next article >

Comments

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
Cancel

COPYRIGHT © 2024 Alvin Liu. alvingoodliu@[email protected] ALL RIGHTS RESERVED.

Theme Made By Seaton Jiang