Skip to content

Instantly share code, notes, and snippets.

@keithmorris
Last active June 5, 2017 10:59
Show Gist options
  • Select an option

  • Save keithmorris/5c8167a5774ff80e868d to your computer and use it in GitHub Desktop.

Select an option

Save keithmorris/5c8167a5774ff80e868d to your computer and use it in GitHub Desktop.

Revisions

  1. keithmorris revised this gist Sep 3, 2014. 1 changed file with 0 additions and 17 deletions.
    17 changes: 0 additions & 17 deletions backup-excludes.txt
    Original file line number Diff line number Diff line change
    @@ -1,17 +0,0 @@
    /.fseventsd
    /.vol
    /.DocumentRevisions-V100
    /.PKInstallSandboxManager
    /.Spotlight-V100
    .Trashes
    .Trash
    /.file
    /dev/*
    /proc/*
    /sys/*
    /tmp/*
    /run/*
    /mnt/*
    /media/*
    /lost+found
    /Volumes
  2. keithmorris created this gist Sep 3, 2014.
    17 changes: 17 additions & 0 deletions backup-excludes.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    /.fseventsd
    /.vol
    /.DocumentRevisions-V100
    /.PKInstallSandboxManager
    /.Spotlight-V100
    .Trashes
    .Trash
    /.file
    /dev/*
    /proc/*
    /sys/*
    /tmp/*
    /run/*
    /mnt/*
    /media/*
    /lost+found
    /Volumes
    11 changes: 11 additions & 0 deletions backup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/bin/bash
    src=/Users/kmorris
    backupPath=/Volumes/Backups/backups

    date=`date "+%Y-%m-%dT%H%M%S"`
    dirname=backup_$date
    excludeFile=/Users/kmorris/bin/backup-excludes.txt

    rsync -aAXPlv --exclude-from=$excludeFile --link-dest=$backupPath/latest $src $backupPath/$dirname
    rm -f $backupPath/latest
    ln -s $backupPath/$dirname $backupPath/latest