[svlug] In need of CVS/SVN checkout script for Production servers

David Rosenstrauch darose at darose.net
Thu Apr 29 12:54:17 PDT 2010


On 04/29/2010 03:29 PM, Daevid Vincent wrote:
> I'm looking for a script that I would run on my production web server that
> would do this or close to it:
>
> 	1. do a CVS/SVN checkout to a new timestamped directory

# tweak the date format as needed to add time fields (see: "man date")
$ date_format="%Y-%m-%d"
$ curr_date=$(date +"$date_format")
$ svn co <svn project url> $curr_date


> 	2. change the symlink from the old directory

$ old_date=$(readlink current)
$ ln -sf $curr_date current


> 	3. change permissions to www-data:www-data on new directory

$ chown www-data:www-data $curr_date


> 	4. and possibly tarball up the old directory.

$ tar -cvf $old_date.tar.gz old_date


The above should do it, give or take some syntax errors.

HTH,

DR


P.S.  Methinks you should invest some time in improving your 
command-prompt-fu!  :-)




More information about the svlug mailing list