Using the awesome rsync-time-backup
script by @laurent22,
OSX users can selectively backup any directory on their computer.
- Download
rsync_tmbackup.sh
into your~/bin
directory:
wget https://raw.githubusercontent.com/laurent22/rsync-time-backup/master/rsync_tmbackup.sh -O ~/bin/rsync-backup
chmod +x ~/bin/rsync-backup
- Download
backup.sh
into your~/bin
directory:
wget https://gist.githubusercontent.com/aleclarson/1badd2a92bec6d1b34125b712b3a31d0/raw/backup.sh -O ~/bin/backup
chmod +x ~/bin/backup
-
Ensure
node
is installed on your computer. π -
Connect your external hard drive, create a partition named "Backup", and run this:
mkdir -p "/Volumes/Backup/Selective-Backups"
-
Run
backup ./path/to/dir
from anywhere to create a backup! π -
Wait a few minutes if the directory has a lot of files... π
Once finished, your backups can be found in the Selective-Backups
directory on
your external hard drive! Each backup is named with its basename and a SHA256 hash
of its full path (to avoid collisions).
To know the original full path of the backup, you can run:
cat "/Volumes/Backup/Selective-Backups/$BACKUP_NAME/.backup-of"
Let me know if this helped you! π