How can I backup remotely the entire Linux server using rsync over SSH?
I can backup my Linux installation with exclusions using rsync
command to my remote Rsync.net account or to any remote storage account through SSH with the following command
rsync -avzh --progress --delete --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/home/*,/lost+found,/backup/*} -e ssh /var [email protected]:remote_folder
Backups are incremental by default.
Parameters explained:
-a: archive mode (it keeps ownership, timestamp, permissions)
-v: verbose
-z: compress file data
-h: human-readable format
--delete: updates remote if files have been deleted from local
--progress: shows progress
Related videos on Youtube
Comments
-
Cadmos over 1 year
I own a CentOS 6.9 box
I need to backup remotely my entire CentOS installation to my Rsync.net storage account through SSH.
How would that be possible including incremental updates and excluding system directories (like lost+found) that are useless for future transfer to other box ?
-
Ignacio Vazquez-Abrams almost 6 yearsExcluding
/home
? That's a little... -
ivanivan almost 6 yearsDifferent parts of your system need different backup proceedures. For example, after initial configuration,
/etc
and subdirs and content rarely change. Your data files (users homes, maildirs, etc) change constantly. I'd split your backup process into multiples and use appropriate for each... -
Cadmos almost 6 yearsI agree but this does not answer the question, even partially on how to do it using rsync over ssh with exclusions
-
-
Alessandro Dotti Contra almost 6 yearsSo, if I understand it correctly, you are missing the incremental part... that's why I'm suggesting you
rsnapshot
. -
Cadmos almost 6 years
rsync
does incremental backup by default, so no, I would not miss it :) .. anyway your answer was only a suggestion for something different instead of an answer to my question. -
frakman1 almost 4 yearsSo in this example, you are backing up the local
/var
folder to the remote? If so, then why all the excludes for other folders that aren't being copied? What does-e
do?