# Remote file collection (rsync, scp, ...)

**URL:** <https://discuss.elastic.co/t/remote-file-collection-rsync-scp/54063>\
**Category:** Logstash\
**Created:** [June 27, 2016, 5:12pm UTC](https://discuss.elastic.co/t/remote-file-collection-rsync-scp/54063 "2016-06-27T17:12:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 28, 2016, 6:27am UTC](https://discuss.elastic.co/t/remote-file-collection-rsync-scp/54063/2 "2016-06-28T06:27:33Z")

</div>

> For scp, "When copying a source file to a target file which already exists, scp will replace the contents of the target file (keeping the inode)." So I think that might be the non-optimal solution.

Does scp truncate the file first or does it overwrite the file in place? In the latter case you'll probably be fine, otherwise you'll probably need to write a script that runs after the rsync operation and either appends new lines to the files that Filebeat monitors or overwrites them in place.

---

_[View the full topic](https://discuss.elastic.co/t/remote-file-collection-rsync-scp/54063)._
