From owner-freebsd-questions@FreeBSD.ORG Wed Nov 21 16:13:31 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E182616A419 for ; Wed, 21 Nov 2007 16:13:31 +0000 (UTC) (envelope-from valerio.daelli@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.228]) by mx1.freebsd.org (Postfix) with ESMTP id 96E2D13C4DD for ; Wed, 21 Nov 2007 16:13:31 +0000 (UTC) (envelope-from valerio.daelli@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so1950636nzf for ; Wed, 21 Nov 2007 08:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=VUMJ2fuyVBdWEjdiJ1N69w0cm89Wyiq+BZeSBYxvPbk=; b=e6c6M7ntwR4GE/mQyAAcF/ttUit+QVsPQmqvfSjUCsscbxm8sUbRkRzIuxkQUqx8CoUMVciFdtJ0RGkAmp5VDr3Jvbu5IPRty1HofUYY54dHNH14oeI3pAxlUaRfAVJXq9CxS2uVo+1tO84xQjdtvjMBUUIgSBkHSC5ieTKnXos= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=SzR7Gd+RRHIX3NgQX+MpaaeHloeZkWf5kc+uvp2PDQz3ZjtOEuWIj3rzvWXJg3vwgHiWcLjGC1H1flEDEP7xEpHbttcRtxipisQkWROMPViy2rPp6/AbcsttgNeVeBRIe3Vm9Z0OtZkSzTLiqhPMnvOhrgxLT+c9oJr8veptJVo= Received: by 10.142.128.6 with SMTP id a6mr2036149wfd.1195661607272; Wed, 21 Nov 2007 08:13:27 -0800 (PST) Received: by 10.142.81.18 with HTTP; Wed, 21 Nov 2007 08:13:27 -0800 (PST) Message-ID: <27dbfc8c0711210813y75555088p6a14644a169cc60a@mail.gmail.com> Date: Wed, 21 Nov 2007 17:13:27 +0100 From: "Valerio Daelli" To: "=?ISO-8859-1?Q?Andreas_Wider=F8e_Andersen?=" , freebsd-questions In-Reply-To: <27dbfc8c0711210555h1a862f5drccb1a6f5bcb1a837@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <23ed14b80711210539w4bed1enc180f8e32ec76881@mail.gmail.com> <27dbfc8c0711210555h1a862f5drccb1a6f5bcb1a837@mail.gmail.com> Cc: Subject: Re: Need help with backup shell script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2007 16:13:32 -0000 > --- > #!/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