Skip to content

Instantly share code, notes, and snippets.

@itechGroup
Created April 14, 2011 06:06
Show Gist options
  • Save itechGroup/918976 to your computer and use it in GitHub Desktop.
Save itechGroup/918976 to your computer and use it in GitHub Desktop.
Скрипт по упаковке сайта на bitrix для его последующего добавления в систему контроля версий
if test -z $1
then
echo "$0 : You must set a project name"
exit 1
else
if test -d /srv/sites/$1/www/
then
# fix permission issues
echo "fix permissions"
cd /srv/sites/$1/
mkdir www2/
mv www/ www2/
cp -R www2/www/ ./
chgrp -R apache www/
chmod -R 775 www/
rm -rf www2/
#start process
cd /srv/sites/$1/www/
#tar upload
tar cfj upload.tar.bz2 --exclude=.svn upload
rm -rf upload/*
#tar bitrix system dirs
tar cfj bitrix.tar.bz2 bitrix/cache/ bitrix/gadgets/ bitrix/image_uploader/ bitrix/images/ bitrix/js/ bitrix/managed_cache/ bitrix/otp/ bitrix/sounds/ b>
rm -rf bitrix/cache/ bitrix/gadgets/ bitrix/image_uploader/ bitrix/images/ bitrix/js/ bitrix/managed_cache/ bitrix/otp/ bitrix/sounds/ bitrix/stack_cach>
#move config
cd ../
mv php_interface/dbconn.php php_interface/dbconn.distr.php
else
echo "There is no such a project"
exit 1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment