Introducing the rsync gem

require 'rsync'

result = Rsync.run("/tmp/trinkets", "/tmp/trinkets2" ,'-a')

The above example uses the rsync gem (which is a wrapper for the rsync program) to copy the trinkets directory to the trinkets2 directory. I observed the trinkets2 directory contained the trinkets directory.

Resources