Permalink
Browse files

Improved readability of logging messages

  • Loading branch information...
asgrim committed Jun 15, 2012
1 parent e607594 commit 48cf8488b953cd68a5b8896618825f2fe8ded033
Showing with 7 additions and 7 deletions.
  1. +7 −7 watch_folder.sh
View
@@ -45,32 +45,32 @@ while read ACTION WATCH FILE
do
FILECHANGED="${WATCH#$CURPATH/}${FILE}"
- echo -ne "$LABEL [$ACTION $FILECHANGED] "
+ echo -e "$LABEL [$ACTION $FILECHANGED]"
case $ACTION in
'MODIFY' | 'MOVED_TO' | 'CREATE')
mkdir -p $SYNC_REMOTE_DIR/${FILECHANGED%/*}
cp $SYNC_LOCAL_DIR/$FILECHANGED $SYNC_REMOTE_DIR/$FILECHANGED
- echo "Copied $SYNC_LOCAL_DIR/$FILECHANGED to $SYNC_REMOTE_DIR/$FILECHANGED"
+ echo -e " Copied\n $SYNC_LOCAL_DIR/$FILECHANGED\n $SYNC_REMOTE_DIR/$FILECHANGED"
;;
'DELETE' | 'MOVED_FROM')
rm $SYNC_REMOTE_DIR/$FILECHANGED
- echo "Removed $SYNC_REMOTE_DIR/$FILECHANGED"
+ echo -e " Removed\n $SYNC_REMOTE_DIR/$FILECHANGED"
;;
'CREATE,ISDIR')
mkdir $SYNC_REMOTE_DIR/$FILECHANGED
- echo "Created $SYNC_REMOTE_DIR/$FILECHANGED directory"
+ echo -e " Create directory\n $SYNC_REMOTE_DIR/$FILECHANGED"
;;
'DELETE,ISDIR' | 'MOVED_FROM,ISDIR')
rm -Rf $SYNC_REMOTE_DIR/$FILECHANGED
- echo "Deleted $SYNC_REMOTE_DIR/$FILECHANGED"
+ echo -e " Delete directory\n $SYNC_REMOTE_DIR/$FILECHANGED"
;;
'MOVED_TO,ISDIR')
cp -af $SYNC_LOCAL_DIR/$FILECHANGED $SYNC_REMOTE_DIR/$FILECHANGED
- echo "Copy directory $SYNC_REMOTE_DIR/$FILECHANGED"
+ echo -e " Copy directory $SYNC_REMOTE_DIR/$FILECHANGED"
;;
*)
- echo "Action [$ACTION] not supported yet."
+ echo " Action [$ACTION] not supported yet."
;;
esac
done

0 comments on commit 48cf848

Please sign in to comment.