head	1.7;
access;
symbols;
locks; strict;
comment	@# @;


1.7
date	2011.11.26.07.46.18;	author dunc;	state Exp;
branches;
next	1.6;

1.6
date	2011.04.22.04.40.23;	author dunc;	state Exp;
branches;
next	1.5;

1.5
date	2010.12.09.00.28.54;	author dunc;	state Exp;
branches;
next	1.4;

1.4
date	2010.05.22.01.02.04;	author dunc;	state Exp;
branches;
next	1.3;

1.3
date	2004.07.31.00.58.28;	author dunc;	state Exp;
branches;
next	1.2;

1.2
date	2000.06.10.07.36.53;	author dunc;	state Exp;
branches;
next	1.1;

1.1
date	2000.06.10.07.36.35;	author dunc;	state Exp;
branches;
next	;


desc
@@


1.7
log
@Improvements from Mintec
@
text
@#!/bin/sh
#set -x
if [ "$1" = "-v" ];then
  v=v
  shift
else
  v=
fi
# Attempt to detect if copying from an ISO: specify --atime-preserve if not
df .|grep 100% >/dev/null 2>&1 && a="" || a=--atime-preserve
if [ -z "$1" -o -z "$2" ];then
  echo 'Usage:-' $0 '[-v] <path> <target-dir>'
  exit 1
fi
if [ ! -d "$2" ];then
  echo "$2 is not a directory"
  exit 1
fi
if [ ! \( -d "$1" -o -f "$1" \) ];then
  echo "$1 is neither a file nor a directory"
  exit 1
fi
tar -cf - $a "$1" | tar -C "$2" -x${v}pUf -
@


1.6
log
@Be sure to cater for filenames with spaces in them
@
text
@d16 1
a16 1
  echo "$2" is not a directory
d20 1
a20 1
  echo "$1" is neither a file nor a directory
@


1.5
log
@Added clarifying comment
@
text
@d15 2
a16 2
if [ ! -d $2 ];then
  echo $2 is not a directory
d19 2
a20 2
if [ ! \( -d $1 -o -f $1 \) ];then
  echo $1 is neither a file nor a directory
d23 1
a23 1
tar -cf - $a $1 | tar -C $2 -x${v}pUf -
@


1.4
log
@Don't use --atime-preserve if copying from an ISO fs
@
text
@d9 1
@


1.3
log
@Unlink destination files before restoring them (preserves symlinks)
@
text
@d2 1
d9 1
d22 1
a22 1
tar -cf - --atime-preserve $1 | tar -C $2 -x${v}pUf -
@


1.2
log
@Extrace files -p to keep permissions
@
text
@d20 1
a20 1
tar -cf - --atime-preserve $1 | tar -C $2 -x${v}pf -
@


1.1
log
@Initial revision
@
text
@d20 1
a20 1
tar -cf - --atime-preserve $1 | tar -C $2 -x${v}f -
@
