Hi,
We are using rsync for syncing remote directories. It is working great along with detailed logs. As the script cron'd and most of the times there're no files to sync we are getting lot of unnecessary log entries and we need to filter them to show only the log entries for the files transferred.
Actual Log: (part of)
2008/04/08 21:43:17 [19631] .d..t.... 09/
2008/04/08 21:43:17 [19631] sent 51 bytes received 26 bytes 1.86 bytes/sec
2008/04/08 21:43:17 [19631] total size is 0 speedup is 0.00
2008/04/08 21:44:49 [5672] building file list
2008/04/08 21:44:49 [5672] done
2008/04/08 21:44:49 [5672] .d..t.... 09/
2008/04/08 21:44:49 [5672] sent 51 bytes received 26 bytes 1.86 bytes/sec
2008/04/08 21:44:49 [5672] total size is 0 speedup is 0.00
2008/04/08 21:46:49 [31047] building file list
2008/04/08 21:46:49 [31047] done
2008/04/08 21:46:49 [31047] .d..t.... 09/
2008/04/08 21:46:49 [31047] <f+++++++ 09/file1.pdf
2008/04/08 21:46:49 [31047] sent 110 bytes received 48 bytes 3.81 bytes/sec
2008/04/08 21:46:49 [31047] total size is 0 speedup is 0.00
2008/04/08 21:48:49 [25274] building file list
2008/04/08 21:48:49 [25274] done
2008/04/08 21:48:49 [25274] .d..t.... 09/
2008/04/08 21:48:49 [25274] sent 71 bytes received 26 bytes 2.40 bytes/sec
2008/04/08 21:48:49 [25274] total size is 0 speedup is 0.00
2008/04/08 21:50:49 [18829] building file list
2008/04/08 21:50:49 [18829] done
2008/04/08 21:50:49 [18829] .d..t.... 09/
2008/04/08 21:50:49 [18829] sent 71 bytes received 26 bytes 2.34 bytes/sec
I achieved the below by using grep:
2008/04/08 21:43:17
2008/04/08 21:43:17 09/
2008/04/08 21:44:49
2008/04/08 21:44:49 09/
2008/04/08 21:46:49
2008/04/08 21:46:49 09/
2008/04/08 21:46:49 09/file1.pdf
2008/04/08 21:48:49
2008/04/08 21:48:49 09/
2008/04/08 21:50:49
2008/04/08 21:50:49 09/
2008/04/08 21:52:49
I need to get only the entries that have a filename (that was actually transferred) as below:
2008/04/08 21:46:49 09/file1.pdf
Thanks
Prvn