Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- TARGET_DIR=/xxxxxx
- killall -9 inotifywait
- /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 |
- /usr/bin/inotifywait -m -r -e moved_to,create -s $TARGET_DIR --format "%w%f" |
- while read filename
- do
- TIMESTAMP=`date "+%F-%H-%M-%S"`
- CMD="/usr/bin/zip -q -y -r /root/item-$TIMESTAMP.zip $TARGET_DIR"
- echo Executing $CMD
- $CMD
- done
Add Comment
Please, Sign In to add comment