Skip to content

Instantly share code, notes, and snippets.

@mhluska
Created May 26, 2013 05:23
Show Gist options
  • Save mhluska/5651797 to your computer and use it in GitHub Desktop.
Save mhluska/5651797 to your computer and use it in GitHub Desktop.
Used with udev to sync a backup drive.
#!/bin/bash
# Find the absolute path of the script.
# See http://stackoverflow.com/a/246128/659910.
DIR="$( cd "$( dirname "$0" )" && pwd )"
# This script is called by `udev` and needs to complete quickly, so we
# background another script. `${1}` contains the device name.
nohup "${DIR}/sync-backup-drive.sh" ${1} >/dev/null 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment