Do not show directories in rsync output

If you’re using –delete in your rsync command, the problem with calling grep -E -v '/$' is that it will omit the information lines like:

deleting folder1/
deleting folder2/
deleting folder3/folder4/

If you’re making a backup and the remote folder has been completely wiped out for X reason, it will also wipe out your local folder because you don’t see the deleting lines.

To omit the already existing folder but keep the deleting lines at the same time, you can use this expression :

rsync -av --delete remote_folder local_folder | grep -E '^deleting|[^/]$'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)