Hey Adam... took me awhile to learn new things!
I'm still not real clear on all the details, but I did just manage to rsync
a folder from one computer to another on my home network. sudo
is not required for rsync
, but you will be prompted for a password on the remote server. (And I don't think you can do this as root, but must be a regular user.)
*** Required for BOTH
*** Required for BOTH
computers: firewall access for ssh
through whatever ports you have set for that.
(I cheated and disabled the firewall on both computers to make it work.
This is my example that is working:
option allows filenames with whitespace, a very handy option for me after I discovered (long ago) that some files were not being backed up properly. I might also suggest the --delete
option which will delete any files in your destination if you delete them in your source. One other suggestion that you might want to consider is --exclude-from=FILE
.... because you may decide that many of the hidden files and folders in your home folder do not need to be transferred to the remote server. Each item, file or folder, would need to be entered on a line by itself in a simple text file. I've used this in the past because, as I remember, there may be a few files that do not want to transfer with rsync
and will cause errors, and so it was easier just to exclude those problems. Whether or not these options are right for you is your decision.
One last option I'll mention is -n
.... which will give you a "dry run" and show you just about the full output as if you were really transferring files, but you're not. It could help you a lot if you see any potential errors before you actually run the full rsync
backup, and especially since your /home folder is likely to be quite large.
So, here is an example that should, I hope, work for you after you enter in the correct IP address and have firewall access. This is the "dry run" version with --delete
also, although there is nothing to delete on a first run.
Oops, one more detail to explain. Note in the code example for you that there is a trailing slash in the source location of /home/adam/ .... that is assuming that you already have a folder on the remote destination named /home/adam. The trailing slash on the source means that it will copy all of the loose files and folders in the source to the destination. Otherwise, it would create another adam folder in your destination, like /home/adam/adam