Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- set -e
- PROJ=$1
- flag=1
- MEDIA_ROOT=/application/CPPIB/CPPIB_UI/s3/*
- WORKSPACE=/home/gale-ciagent/workspace
- DUMPDATE=`date +%F-%H-%M-%S`
- source /home/gale-ciagent/scripts/source-files/$PROJ
- if [ ! -d "$WORKSPACE/$PROJ" ];then
- mkdir -p $WORKSPACE/$PROJ
- fi
- # # Check for Application UI or Services
- # echo $PROJ | grep services
- # if [ $? -eq 0 ]; then
- # flag=0
- # fi
- # copy the media content into the workspace
- cp -rp $MEDIA_ROOT $WORKSPACE/$PROJ
- cd $WORKSPACE/$PROJ
- # Loop through the file in the workspace for CMS media and Solidus public folder
- if [ $flag -eq 0 ]; then
- tar -czvf $PROJ-public-$DUMPDATE.tar.gz public
- if [ $? -eq 0 ];then
- rm -rf public
- fi
- else
- tar -czvf $PROJ-media-$DUMPDATE.tar.gz media
- if [ $? -eq 0 ];then
- rm -rf media
- fi
- fi
- # DB dump command
- PGPASSWORD=$DB_PASSWORD \
- pg_dump -h $DB_HOST -p $DB_PORT -U $DB_USERNAME $DB_NAME > $WORKSPACE/$PROJ/$PROJ-db_$DUMPDATE.sql
Add Comment
Please, Sign In to add comment