#!/bin/bash DATE=`date +%Y-%m-%d` DIR="/home/www/www.phpguru.org/htdocs/downloads/datagrid/$DATE" clear # Delete the "latest" link echo -e "Deleting the current release directory" rm -f /home/www/www.phpguru.org/htdocs/downloads/datagrid/latest rm -rf $DIR # Make the new release directory echo -e "Creating new release dir ($DIR)" mkdir /home/www/www.phpguru.org/htdocs/downloads/datagrid/$DATE # Copy the files over echo -e "Copying the files over" cp -R /home/www/www.phpguru.org/htdocs/datagrid/* $DIR # Recreate the link echo -e "Recreating the link" ln -s $DIR /home/www/www.phpguru.org/htdocs/downloads/datagrid/latest