2

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 ?

3
  • Excluding /home? That's a little... Commented May 26, 2018 at 11:35
  • Different 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...
    – ivanivan
    Commented May 27, 2018 at 20:41
  • I agree but this does not answer the question, even partially on how to do it using rsync over ssh with exclusions
    – Cadmos
    Commented May 27, 2018 at 20:52

1 Answer 1

1

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

rsync man page

4
  • So, if I understand it correctly, you are missing the incremental part... that's why I'm suggesting you rsnapshot. Commented May 27, 2018 at 22:26
  • 2
    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.
    – Cadmos
    Commented May 27, 2018 at 22:41
  • So 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?
    – Frak
    Commented Jun 13, 2020 at 1:08
  • @Cadmos: by "incremental backup" he means a backup that keeps some "history" or "versioning", where you can restore a file as it was in a given point in the past, not just the most recent version. In this sense rsync is a mirror backup.
    – MestreLion
    Commented May 27, 2022 at 11:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .