[Locomotive-users] [Req] : project snapshot (zip)

Stephen Waits steve at waits.net
Sat Feb 3 17:01:35 GMT 2007


On Feb 2, 2007, at 5:21 AM, Alain Ravet wrote:

> I've automated it through a script that I placed in
> the dock, but I still need to create one script for each new project
> so...

Why not just write a shell (or perl, python, or ruby) script and drop  
it in your ~/bin?  Then you'd have one script that could work for  
everything.

Though, of course you'd have to run it from the shell, in the base  
directory of the project you'd want archived.  But, to me, that's  
just about as easy as anything else you might need to do (or easier).

--Steve

P.S. - the script could look like this:

archive.sh
==========
#!/bin/sh

# where to store the archive (note trailing)
ARCHIVE_DIR="~/RailsProjectArchives"

# figure out a name, based on current directory + datestamp
CWD=`pwd`
BASE_CWD=`basename $CWD`
DATE=`date +"%F.%R"`
ARCHIVE_NAME="$ARCHIVE_DIR/$BASE_CWD.$DATE.tar.gz"

# create the archive
tar zcvf $ARCHIVE_NAME .



More information about the Locomotive-users mailing list