Guest User

Untitled

a guest
Jul 20th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #! /bin/bash
  2. set -e
  3.  
  4. PROJ=$1
  5. flag=1
  6. MEDIA_ROOT=/application/CPPIB/CPPIB_UI/s3/*
  7. WORKSPACE=/home/gale-ciagent/workspace
  8. DUMPDATE=`date +%F-%H-%M-%S`
  9. source /home/gale-ciagent/scripts/source-files/$PROJ
  10.  
  11. if [ ! -d "$WORKSPACE/$PROJ" ];then
  12. mkdir -p $WORKSPACE/$PROJ
  13. fi
  14.  
  15. # # Check for Application UI or Services
  16. # echo $PROJ | grep services
  17. # if [ $? -eq 0 ]; then
  18. # flag=0
  19. # fi
  20.  
  21. # copy the media content into the workspace
  22. cp -rp $MEDIA_ROOT $WORKSPACE/$PROJ
  23. cd $WORKSPACE/$PROJ
  24.  
  25. # Loop through the file in the workspace for CMS media and Solidus public folder
  26. if [ $flag -eq 0 ]; then
  27. tar -czvf $PROJ-public-$DUMPDATE.tar.gz public
  28. if [ $? -eq 0 ];then
  29. rm -rf public
  30. fi
  31. else
  32. tar -czvf $PROJ-media-$DUMPDATE.tar.gz media
  33. if [ $? -eq 0 ];then
  34. rm -rf media
  35. fi
  36. fi
  37.  
  38. # DB dump command
  39. PGPASSWORD=$DB_PASSWORD \
  40. 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