Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jun 2004 11:01:14 -0400
From:      Bart Silverstrim <bsilver@chrononomicon.com>
To:        freebsd-questions Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Scripting backup of file naming?
Message-ID:  <859B50A7-B893-11D8-9892-000A956D2452@chrononomicon.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?859B50A7-B893-11D8-9892-000A956D2452>