<\/a>Yeah, you're a total hacker.<\/p><\/div>I needed to backup my large collection of cat pictures today and realized how big of a pain moving 2TB of files is using the usual terminal copying tools. Luckily, moving around lots of files, and lots of large files, via terminal is really easy using rsync. Rsync has some nice tricks up it’s sleeve. It can perserve permissions, compress files on the fly, and do some filtering as it copies. Oh yeah, and if it’s interrupted you can always resume, unlike commands like cp, dd, and mv.<\/p>\n
Backup one directory to another, recursively<\/h2>\n $rsync -r \/path\/of\/source \/path\/to\/backup<\/code> \nNow, that’s fine and dandy if you’re working on a local machine but if you’re moving stuff remotely you need some extra help from nohup. Nohup is a command that means “no hang up”, as in, even if your session is disconnected nohup will keep running. You’ll also need an\u00a0ampersand\u00a0to deal with any output.<\/p>\nBackup directory recursively, perserving permissions, and ignoring terminal disconnects.<\/h2>\n $nohup rsync -ra \/path\/of\/source \/path\/to\/backup &<\/code> \nUsing this command with sudo is a bit tricky, you can’t just throw a sudo infront of it and let it run. Instead you have to do two commands<\/p>\n$sudo -i \n#nohup rsync -ra \/path\/of\/source \/path\/to\/backup &<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"I needed to backup my large collection of cat pictures today and realized how big of a pain moving 2TB of files is using the usual terminal copying tools. Luckily, moving around lots of files, and lots of large files, via terminal is really easy using rsync. Rsync has some nice tricks up it’s sleeve. […]<\/p>\n","protected":false},"author":2,"featured_media":559,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[83],"tags":[102,103,104,54,100,101],"psp_head":"
Move lots of files using rsync for fun and profit \u2013 Today Was Awesome<\/title>\r\n \r\n \r\n \r\n","_links":{"self":[{"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/posts\/552"}],"collection":[{"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/comments?post=552"}],"version-history":[{"count":10,"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/posts\/552\/revisions"}],"predecessor-version":[{"id":564,"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/posts\/552\/revisions\/564"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/media\/559"}],"wp:attachment":[{"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/media?parent=552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/categories?post=552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/todaywasawesomecom.local\/wp-json\/wp\/v2\/tags?post=552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}