Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 4th, 2012  |  syntax: None  |  size: 0.53 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Bash script stops execution in the middle of the script without any error
  2. #!/bin/sh
  3. DATE=`date +%Y-%m-%d_%H%M.%S`
  4. BASEDIR="/var/www/db"
  5. RELEASEDIR="$DATE";
  6. RELEASEDIRFULL="$BASEDIR/releases/$RELEASEDIR"
  7. mkdir -p "$RELEASEDIRFULL"
  8. echo "Chdir to "$RELEASEDIRFULL""
  9. cd "$RELEASEDIRFULL"
  10. echo "Getting copy from dev"
  11. ssh dev.example.tld "cd /tmp; cd /sites/db; tar -zcvp --exclude data --exclude scripts -f - *" | tar zxvpf -
  12. ln -s /var/www/db/data data
  13. ln -s /var/www/db/scripts scripts
  14. cd $BASEDIR
  15. rm htdocs; ln -s releases/$RELEASEDIR htdocs