From owner-freebsd-questions@FreeBSD.ORG Mon Jun 7 15:02:06 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 C2B2816A4CE for ; Mon, 7 Jun 2004 15:02:06 +0000 (GMT) Received: from destiny.chrononomicon.com (mail.chrononomicon.com [65.193.73.208]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51BE143D2F for ; Mon, 7 Jun 2004 15:02:06 +0000 (GMT) (envelope-from bsilver@chrononomicon.com) Received: from [IPv6:::1] (destiny.chrononomicon.com [192.168.1.42]) by destiny.chrononomicon.com (Postfix) with ESMTP id B6DA41FDFF for ; Mon, 7 Jun 2004 11:01:15 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v618) Content-Transfer-Encoding: 7bit Message-Id: <859B50A7-B893-11D8-9892-000A956D2452@chrononomicon.com> Content-Type: text/plain; charset=US-ASCII; format=flowed To: freebsd-questions Questions From: Bart Silverstrim Date: Mon, 7 Jun 2004 11:01:14 -0400 X-Mailer: Apple Mail (2.618) Subject: Scripting backup of file naming? 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: Mon, 07 Jun 2004 15:02:06 -0000 Hello scripting gurus.. I'm sure this is an easy one for someone out there. Here's what I'd like to do, and hoping someone out there knows a simple way to do this without ripping my hair out. Scenario: *Two servers, Server1 and Server2. *I want Server1 to copy a set of files from Server2 on a regular basis using cron and scp. I should be able to do that by just generating a ssh key and automating the login from Server1 into Server2. *problem; on server1, I'm going to have two directories: ~/archive and ~/workingdir. I want the scp to move the files from server2 to ~/workingdir, tar and zip them as a file name with a date attached (like backup06072004.tgz) to make the filename distinctive, then move that file from ~/workingdir to ~/archive. The filename would need to be distinctive both to allow for reference when needing to restore a snapshot and also to keep the archives from overwriting each other when moved over. Is there a simple way to do this with a script running from cron? -Bart