A quick thread about backing up with rsync...

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
11,229
Reaction score
9,741
Credits
93,186
I was asked to start a thread about this command:

Code:
time rsync -r --progress ~/ /media/kgiii/device_name/path/to/backup/dir

All you really need from that is rsync -r ~/ /path/to/backup/location.

The time shows you how long it took when the command finishes.
The -r is recursive.
The --progress shows you the progress of the transfers.
The ~/ is your home directory.
The variable is the path to the directory where you want to back things up.

If it's a network share, you just adjust the path to match that - which will depend on your settings.
 


Nice one!
But you might want to use -p option with time:

time -p rsync -r --progress ~/ /media/kgiii/device_name/path/to/backup/dir

-p print the timing summary in the portable Posix format
 
I find this one from the rsync man page it useful one as well.
rsync -avz foo:src/bar /data/tmp

This would recursively transfer all files from the directory src/bar on the machine foo into the /data/tmp/bar directory on the
local machine. The files are transferred in archive mode, which ensures that symbolic links, devices, attributes, permissions,
ownerships, etc. are preserved in the transfer. Additionally, compression will be used to reduce the size of data portions of
the transfer.
And setting to option to delete files on the destination side that aren't on the source side I tend to use as well since I want to make sure both sides have the same files.
Code:
 rsync -avz --delete foo:src/bar /data/tmp
 
And setting to option to delete files on the destination side that aren't on the source side I tend to use as well since I want to make sure both sides have the same files.

I probably should have it delete.

But you might want to use -p option with time:
Maybe? I like the time format it uses.

This might be useful.


That's probably easier for people to read than the actual man page, but the content appears to be the same.

Also, yeah, rsync has a bunch of options.
 

Members online


Latest posts

Top