Advertisement
dcuddihy-acr-me

Untitled

Oct 7th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #
  2. # Bundle up and move out old lgm-tree
  3. #
  4. set -x
  5. set -e
  6.  
  7. echo "Started: " $(date)
  8. echo $PYTHONPATH
  9. export TERM=xterm
  10. export TMPDIR=/tmp/$(date +%s)
  11. mkdir $TMPDIR
  12.  
  13. function lgm_export () {
  14. local TMPDIR="$1"
  15. local SRCDIR="$2"
  16. local TGTDIR=${TMPDIR}/$(dirname "$SRCDIR")
  17. mkdir -p "$TGTDIR"
  18. mv "$SRCDIR" "$TGTDIR"
  19. }
  20.  
  21. export SHELL=/bin/bash
  22. export -f lgm_export
  23.  
  24. find /opt/var/me.acr/ginger/nobody/ -name lgm | parallel "lgm_export $TMPDIR {}"
  25.  
  26. tar cvfz /var/tmp/lgm-bundle-$(date +%s).tgz $TMPDIR
  27. rm -rf $TMPDIR
  28.  
  29. echo "Finished: " $(date)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement