Tuesday, March 2, 2021

Clean up the output of rsync to get rid of the useless directores with no change.

 

https://stackoverflow.com/questions/8580873/do-not-show-directories-in-rsync-output

cefn@cefn-natty-dell:~$ mkdir rsynctest
cefn@cefn-natty-dell:~$ cd rsynctest/
cefn@cefn-natty-dell:~/rsynctest$ mkdir 1
cefn@cefn-natty-dell:~/rsynctest$ mkdir 2
cefn@cefn-natty-dell:~/rsynctest$ mkdir -p 1/first 1/second
cefn@cefn-natty-dell:~/rsynctest$ touch 1/first/file1
cefn@cefn-natty-dell:~/rsynctest$ touch 1/first/file2
cefn@cefn-natty-dell:~/rsynctest$ touch 1/second/file3
cefn@cefn-natty-dell:~/rsynctest$ touch 1/second/file4

cefn@cefn-natty-dell:~/rsynctest$ rsync -r -v 1/ 2
sending incremental file list
first/
first/file1
first/file2
second/
second/file3
second/file4

sent 294 bytes  received 96 bytes  780.00 bytes/sec
total size is 0  speedup is 0.00


cefn@cefn-natty-dell:~/rsynctest$ rsync -r -v 1/ 2 | grep -E -v '/$'
sending incremental file list
first/file1
first/file2
second/file3
second/file4

sent 294 bytes  received 96 bytes  780.00 bytes/sec
total size is 0  speedup is 0.00

gets rid of the crap

example gets rid of crap.  the n parameter makes it a report instead of moving data.
cd <directory>
rsync -anzv ./misc/* /e13/misc| grep -E -v '/$'

 

 

--30--

No comments:

Post a Comment