Sync files with rsync

To sync filesystems over ssh (with port):

$> rsync -azvu --exclude-from='./exclude.txt' -e 'ssh -p 26 -o StrictHostKeyChecking=no' user@host:/PATH/TOREMOTE/FILE/ORFOLDER/ /PATH/TO/LOKAL/FILEORFOLDER;

Useful parameters

  • -o StrictHostKeyChecking=no –  tells the the source host to accept the ssh-key from the destination host
  • –exclude-from=’./exclude.txt’ – in exclude.txt each line specifies a path to ignore through synchronization
  • –dry-run – only simulate what would have been transferred
  • –delete – deletes extraneous files from destination host, if the were not found on the source system (anymore)
  • –ignore-existing – ignores all files that already exist on target

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.