Guest User

Untitled

a guest
Aug 16th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #!/bin/sh
  2. TARGET_DIR=/xxxxxx
  3.  
  4. killall -9 inotifywait
  5. /usr/bin/inotifywait -d -r -e moved_to,create -s $TARGET_DIR --timefmt "%F:%T" --format "%T %w%f %e" -o /root/deploy-monitoring.log |
  6. /usr/bin/inotifywait -m -r -e moved_to,create -s $TARGET_DIR --format "%w%f" |
  7. while read filename
  8. do
  9. TIMESTAMP=`date "+%F-%H-%M-%S"`
  10. CMD="/usr/bin/zip -q -y -r /root/item-$TIMESTAMP.zip $TARGET_DIR"
  11. echo Executing $CMD
  12. $CMD
  13. done
Add Comment
Please, Sign In to add comment