Quantcast
Viewing latest article 1
Browse Latest Browse All 2

Answer by chaos for Save only specific output to log file

When you call unison in your sync.sh script call it as follows:

unison ... 2>&1 | grep -vE '^[\|/-]|^$'

This will remove (-v) all line that match the regual expression: All line beginning with one of those characters: \|/-, or complete empty lines (^$).


Edit: If you want the cronjob to be filtered, use:

@reboot /path/to/sync.sh -batch 60 2>&1 | grep -vE '^[\|/-]|^$' >> /path/to/logfile

Viewing latest article 1
Browse Latest Browse All 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>