{"authors":["utzer"],"canonical_url":"https://newblog.utzer.de/2019/03/15/rsync/","categories":["Linux"],"content":"This is kind of my cheat sheet, nothing fancy, just what I need.\n\n#### Command:\n\n```\nrsync -chavzP --stats 'host:~/RemotePath' ./LocalPath\n```\n\nrsync - Befehl  \n -c, --checksum  \n -h, --human-readable  \n -a, --archive  \n -v, --verbose  \n -z, --compress  \n -P - equivalent to --partial --progress  \n --stats - This tells rsync to print a verbose set of statistics on the file transfer  \n 'host:~/RemotePath' - is the source path (in this case a remote path.  \n ./LocalPath - ist the destination\n\n#### Some more variants:\n\nfrom local to remote  \n\n```\nrsync -chavzP --stats ~/FileName.file 'host:~/path/'\n```\n\nLeave the z if compression does not matter (in most cases it does not matter).  \n\n```\nrsync -chavP --stats ~/FileName.file 'host:~/path/'\n```\n\nRsync to **MOVE** a folder from A to B. Source will be **deleted**!!  \n\n```\nrsync -hcavP --stats --remove-source-files ./source ./destination_folder\n```\n\nRsync can be used from local to local to copy files. It can be used from 'remote' to local or vom local to 'remote', unfortunately it can not copy from remote to remote.\n\n**Don't forget to include the ticks around the remote (host) part.**\n\nI this \"rsync -chavzP --stats ~/FileName.file 'host:~/path/'\" the \"host\" is defined in my ~/.ssh/config, but you can also do something like this:  \n\"rsync -chavzP --stats ~/FileName.file 'user@example.org:~/path/'\"\n\nThis even work via ssh jump hosts. I will write something about that soon.\n","content_format":"markdown","date":"2019-03-14T23:00:50Z","description":"This is kind of my cheat sheet, nothing fancy, just what I need. #### Command: ``` rsync -chavzP --stats 'host:~/RemotePath' ./LocalPath ``` rsync - Befehl -c, --checksum -h, --human-readable -a, --archive -v, --verbose -z, --compress -P - equivalent to --partial --progress --stats - This tells rsyn","html_url":"https://newblog.utzer.de/2019/03/15/rsync/","json_url":"https://newblog.utzer.de/2019/03/15/rsync/index.json","lastmod":"2019-03-14T23:00:50Z","markdown_url":"https://newblog.utzer.de/2019/03/15/rsync/index.md","media":[],"schema_version":1,"tags":["network","rsync","server","SSH"],"title":"rsync","type":"blog_post"}