Skip to content

Instantly share code, notes, and snippets.

@brianlow
Created August 30, 2014 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianlow/e6168bfa2285c79463ce to your computer and use it in GitHub Desktop.
Save brianlow/e6168bfa2285c79463ce to your computer and use it in GitHub Desktop.
#
# Copy logs from the vagrant share (hosted by Windows) to ~/logs
# This is because logstash tracks files using their inode number
# but this number may change each time the vm is booted.
#
# rsync options
# -r recursive
# -t transfer file mod times and use to skip files
# -v verbose
# --inplace update files rather than write new and rename
# --no-W force delta compression even though source+destination are local
#
* * * * * flock -n /home/vagrant/rsync-cron-job.lock -c 'echo "";echo "---";date;rsync -rtv --inplace --no-W /vagrant/logs/ /home/vagrant/logs/' >> /home/vagrant/rsync-cron-job.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment