Linux – rsync copy new files only, no updates

linuxrsync

I would like to use rsync to copy files from a remote server. I would like to

  • only copy files from server, not push any back out.
  • copy files that don't exist. If the remote file is newer I do not want to copy it
  • have it automatic. This prompts me for my password everytime and i would like it to be ran by cron. So how do I run it in a bash script executed by cron?

Best Answer

Points 1 and 2: How to specify what to copy is best answered by reading the rsync manpage. In your case, look especially at --ignore-existing flag.

Point 3: This tutorial should get you going using passwordless ssh with rsync. Summary: set up passwordless ssh and use '-e ssh' to tell rsync to use ssh instead of rsh to connect to the remote host.