Date: Wed, 21 Nov 2007 17:13:27 +0100 From: "Valerio Daelli" <valerio.daelli@gmail.com> To: "=?ISO-8859-1?Q?Andreas_Wider=F8e_Andersen?=" <wodfer@gmail.com>, freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Need help with backup shell script Message-ID: <27dbfc8c0711210813y75555088p6a14644a169cc60a@mail.gmail.com> In-Reply-To: <27dbfc8c0711210555h1a862f5drccb1a6f5bcb1a837@mail.gmail.com> References: <23ed14b80711210539w4bed1enc180f8e32ec76881@mail.gmail.com> <27dbfc8c0711210555h1a862f5drccb1a6f5bcb1a837@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> --- > #!/bin/sh > > MOUNT=/external > DATE=`date +%Y%m%d%H%M` > > mount /dev/da2 $MOUNT #Change device name > find $MOUNT -mtime +30 -delete > mkdir $MOUNT/$DATE > cp -rp /backup/* $MOUNT/$DATE > umount /external > --- > Please substitute the line starting with 'cp' with this one: rsync -rlpgoD /backup/ $MOUNT/$DATE (you must portinstall rsync as well) since 'cp -rp' preserve modification times as well while 'rsync -rlpgoD' preserve permission but not mtime. Sorry Valerio Daelli
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?27dbfc8c0711210813y75555088p6a14644a169cc60a>