From owner-freebsd-questions@FreeBSD.ORG Wed Jun 9 15:06:11 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 154FB16A4CE for ; Wed, 9 Jun 2004 15:06:11 +0000 (GMT) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38F5C43D1D for ; Wed, 9 Jun 2004 15:06:09 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i59F5r6m081850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Jun 2004 16:05:53 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i59F5rd4081849; Wed, 9 Jun 2004 16:05:53 +0100 (BST) (envelope-from matthew) Date: Wed, 9 Jun 2004 16:05:53 +0100 From: Matthew Seaman To: Karen Donathan Message-ID: <20040609150553.GA81647@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Karen Donathan , freebsd-questions@freebsd.org References: <20040609102723.H167@gwhs.kana.k12.wv.us> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: <20040609102723.H167@gwhs.kana.k12.wv.us> User-Agent: Mutt/1.5.6i X-Greylist: Message not sent from an IPv4 address, not delayed by milter-greylist-1.3.8 (smtp.infracaninophile.co.uk [0.0.0.0]); Wed, 09 Jun 2004 16:05:53 +0100 (BST) X-Virus-Scanned: clamd / ClamAV version devel-20040604, clamav-milter version 0.71c on smtp.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions@freebsd.org Subject: Re: Backup question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2004 15:06:11 -0000 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 09, 2004 at 10:29:27AM -0400, Karen Donathan wrote: > What is the best way to back up the html directory? We do not have a > tape drive. Is there a way to have an automated .tar file created and > sent as email so I could save it on another server? Any help would be > great! Yeah. This sort of thing is easy to do with a very small shell script. From your specifications, something like this will do the job: #!/bin/sh PATH=3D/bin:/usr/bin ; export PATH htmldir=3D/usr/local/www/data recipient=3D"somebody@example.com" today=3D$(date +%Y%m%d) tar -cvjf - ${htmldir} | uuencode backup-${today}.tar.bz2 | \ mail -s "Backup of ${htmldir} on ${today}" ${recipient} \ >>/var/log/backup.log 2>&1 Save that to a file, make it executable and run it out of root's crontab on a daily basis: @daily /usr/local/bin/mybackupscript (be sure you understand the difference between /etc/crontab and /var/cron/tabs/root, and how to use crontab(1) correctly: do *not* feed /etc/crontab into the crontab command.) The recipient should use procmail or similar to feed the backup messages into uudecode and so extract the compressed tar file. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --opJtzjQTFsWo+cga Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAxydRiD657aJF7eIRAgrGAJ9+SBO8uyFHlmnWvbsEpf5QMFXbSACgr3HY mOD59rNSyZFkFl4fQK795kQ= =fRsv -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga--