

(Replace tnelson with your user name, and DocsBackup with your desired target for the copy.)

To tell rsync we want all the files and folders, including everything in subdirectories, we include the -r option. Let’s look at a basic rsync command that will copy a directory and all sub-directories it may contain. Notice that the time stamp on all the copied files is set to the current date.) (The rsync -r command copied all the files on my Desktop to my USB flash drive named DocsBackup. While the number of options can get long, the format is always the same the rsync command followed by any optional switches, then the source directory followed by the destination directory. Rsync -options theSourceDirectory theDestinationDirectory Rsync uses a simple structure for issuing commands:
#Linux folder backup recursive series
If you’re new to using the Terminal app, check out the Rocket Yard series Tech 101: Introduction to the Mac’s Terminal App. The Terminal app is used to invoke rsync and its various commands. Always check version compatibility when using rsync with remote systems. You should have no problems using the older Mac version with remote platforms that have one of the newer versions installed, but going the other direction could have unexpected results. The Mac version has been at 2.6.9 for a number of years, while the current version is at 3.1.3 (as of January, 2018). The version of rsync that’s distributed with the Mac tends to lag behind the current version available on the rsync website.
#Linux folder backup recursive install
If you’re looking for a copy of rsync to install on a system other than a Mac, or you’re just interested in discovering more about this versatile app, you can check out the rsync website.īefore we get into details about using rsync on the Mac, a note about versions. If you wish to use rsync with a remote system, you’ll need to ensure that both the local system and the remote system have rsync installed. In this Rocket Yard Guide, we’re going to concentrate on using rsync locally. It can also be used for basic file copying, and for maintaining file synchronization between one or more folders, either locally or with a remote system (think cloud-based storage, as an example). The rsync program has a number of features that make it a good candidate for building local, as well as remote, backup, archiving, and synchronization systems. Written for Unix operating systems, rsync is included with the Mac and can be accessed directly from Terminal, or used within a number of scripting languages. You may not have heard of rsync it’s a file transfer and synchronization program that’s often used to create elaborate and complex backup systems.
