Results 1 to 3 of 3

Thread: Rsync Setup

  1. #1
    Join Date
    Jul 2010
    Beans
    4

    Rsync Setup

    I've new to Xubuntu and I'm trying to figure out how to write a complex setting of Rsync or Rdiff-Backup.

    I need to write a backup that take what's on my remote server and back it up to a specific folder on my computer. I would also like to run a backup of mysql this way too if possible. It would be nice to keep like the last 5 backups and no more.

    I would like to automate this if possible.
    Last edited by maddtechwf; March 12th, 2013 at 12:57 AM.

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Rsync Setup

    For MySQL, I posted a script here that does what you ask.

    For rsync, a simple beginning would be:

    Code:
    cd /path/to/the/backup/folder
    rsync -av remote_server:/path/to/something .
    Take a look at the --include-from and --exclude-from options for rsync to specify multiple directories to include or exclude from the transfer.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Rsync Setup

    Hi maddtechwf. Welcome to the forums

    Let me start by noting that rsync is not a comprehensive backup solution. Granted, it is a powerful tool, and it is used by a lot of backup software in the background.

    For copy/mirror it is fantastic, and very easy to implement.

    When you start thinking on as schedule the includes full, incremental and differential backups, an rsync command won't be enough. Don't get me wrong. You could, indeed, write some scripts that take care of all that (take a look at these examples). But scripts need to be tested, debugged, etc. Considering going this route would depend on the urgency, importance of your data, and your scripting abilities.

    I would start by taking a look at this, and this reviews of several backup tools.

    Having said that, here's a few pointers:

    rsync:
    For more complex backups, there are several approaches:
    • for differential you can use the option --compare-dest (see here).
    • for incremental, you can use the combo --backup and --backup-dir (see here), or use hardlinks (option -h) (see here).

    Here's another guide for full and incremental backups using rsync.

    Automation:
    To automate tasks, take a look at cron.

    SQL:
    • You can't rsync a live database. You may have to stop it, copy it, and restart the database again.
    • An alternative is create a dump of the database, and then rsync that.
    • SQL have internal functionality for replication. You may take alternatives of that too.

    Hope it helps. Let us know how it goes.
    Regards.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •