/ factorpad.com / tech / linux-essentials / rsync-command.html
An ad-free and cookie-free website.
Beginner
Learn to securely backup file systems at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux rsync Command Summary with Examples (3:24)
Our seventy-fourth word, or command to memorize is
rsync
from our category
Files.
rsync
allows you to synchronize
(backup) file systems.
-options | description |
---|---|
-h ,
--help |
Print help screen |
-a |
Use file archive |
-v |
Print verbose messages |
Recall from the last block of six videos, we've been compressing files and making archives, now we'll create backups of those archives, often called mirrors, on other disk drives, and we could even do it remotely (ie, online backup).
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s)
.
The rsync
command has
over 50 options and the arguments include the source
followed by the destination.
Like most commands, help is available with double-dash
--help
. Option
-a
creates an archive, meaning
sub-directories too. And -v
, like
with other commands, gives a progress report.
So why is rsync
an important command?
Well, rsync
not only saves time when
making backups versus plain copying, but also syncs only updated files,
saving bandwidth, plus it can also be scheduled and automated.
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.
Here we go. Because this is normally an administrator function, with
rsync
, I'll
just show the basics. Let's do a directory listing.
If you haven't been with us from the start, we have been busy.
So, now we'll back this up, and in the home directory create a target which imagine could be on another file system remotely (through ssh for example) and call it, cleverly, backup.
Next, let's do an rsync
with
with options -av
, the source
../linux
, like this, and the
destination ../backup
, like this, and
it'll put a backup of the whole directory of files.
And then last, let's verify with an ls
on the directory ../backup/linux
and
make sure everything showed up.
Okay now you know how to use rsync
.
And you know the syntax for commands, options and arguments.
One last tip about the rsync
command. So just like the feeling of (backup) safety on Windows, or Time
Machine on Mac, it's nice to know data is safe and
rsync
provides that for you.
Okay, thanks for visiting today. I hope this was a helpful
introduction to the rsync
command.
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
If you love learning like we do here, then please consider giving back in some way that works for you. Follow, subscribe, contribute, join.
tar
command,
hit Back.chmod
, click Next./ factorpad.com / tech / linux-essentials / rsync-command.html
A newly-updated free resource. Connect and refer a friend today.