LAPINPT

makeiso sh script

Jul 7th, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.49 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. SOURCE=$1
  4. TARGET="${SOURCE%/*}"
  5. LOG="$TARGET-Log.txt"
  6.  
  7. before="$(date +%s)"
  8.  
  9. genisoimage  -v -J -allow-limited-size -V "$TARGET" -o "$TARGET".iso "$SOURCE" >> "$LOG" 2>&1
  10.  
  11. after="$(date +%s)"
  12. elapsed_seconds="$(expr $after - $before)"
  13.  
  14. echo -e "\n\n\n" >> "$LOG" 2>&1
  15. echo JOB DONE IN : $(date -d "1970-01-01 $elapsed_seconds sec" +%H:%M:%S) >> "$LOG" 2>&1
  16.  
  17. FULLPATH=$0
  18. FILENAME=${FULLPATH##*/}
  19.  
  20. mail -s "$FILENAME - $TARGET" some@mail.com < "$LOG"
  21.  
  22. sleep 5
  23.  
  24. rm "$LOG"
Advertisement
Add Comment
Please, Sign In to add comment