Grsync for Linux, Unix and BSD

Grsync is a visual tool to help you configure rsync. It is available for Windows, Mac, and Linux, takes minutes to configure, and automation is a snap.

Grsync can be used configure different backup sessions so that different backup jobs can be run on different schedules. Grsync can also utilize SSH keys for password-free authentication. Everything you need to get going is included in one download. With Grsync, your backups will be worry-free in no time at all!

Installation

Installation of Grsync is a snap:

  1. Download the Grsync package most appropriate for your platform.
  2. Installation will differ depending on your platform, so let us know if you need assistance:

Step One: Create the Backup Directory

To begin, open a terminal (Gnome-Terminal, Xterm, Kterm, etc.) and create a directory for your backup files. We recommend /backup.

sudo mkdir /backup

Step two: Generating an SSH Key Pair with ssh-keygen

Notes:
  • Each of the following commands are entered as a single line.
  • You'll want to run all of the commands here as the 'super-user' (using sudo), so that you have full access to all the files on your machine.
1. Create an SSH key pair with ssh-keygen
sudo ssh-keygen -f /backup/ssh_key -t rsa -N ''
Note the command ends with two single quote characters.
  • Why do I need an SSH keypair? »
  • « OK. Hide this

An SSH key pair allows you to securely login to your backup server without entering a password each time.

2. Upload and activate the public key to your EVBackup account
sudo rsync -e ssh /backup/ssh_key.pub user@user.evbackup.com:ssh_keys/key1.pub
ssh user@user.evbackup.com addkeys
Show Me
Successful SSH key pair generation in Linux

Successful SSH key pair generation in Linux

  • Notes about uploading »
  • « OK. Hide this
  • Substitute user with your EVBackup account name.
  • When you enter this command, you might see a message indicating that your computer is doesn't recognize the server. Just enter yes when prompted and you'll never be bothered again.
  • You'll be asked to enter the password for your EVBackup account. Once the key is uploaded and activated, this won't be necessary again.
  • If Terminal simply returns (looking as though nothing has happened), then you have successfully uploaded your key!
3. Test that you can login without a password
sudo ssh -i /backup/ssh_key user@user.evbackup.com
  • How do I know if it worked? »
  • « OK. Hide this

If you were successful, then something very similar to the following will appear in Terminal:

Last login: Thu Jul 15 16:16:44 2010 from c-28-26-13-101.
Copyright (c) 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.

FreeBSD 6.4-STABLE (EXAVAULT) #1:
[your-account@quark ~]$

Step Three: Configuring a Backup Session

Show Me
Setting Grsync preferences

Setting Grsync preferences

Now it's time to open up Grsync and get it configured. First, set your prefereneces by clicking the File menu, selecting Preferences. Here are a few suggestions for Grsync preferences:

  • ✓ Show rsync output by default
  • ✓ Show error list when finished
  • ✓ Enable logging

Saving a Grsync Backup Session

Show Me
Adding a Grsync session

Adding a Grsync session

The next thing to do is to create a backup session. Just click the add button on the toolbar.

  • Give your backup session a name that will be descriptive like, "PhotoShoots" or "Web-files".
  • You'll want to avoid using s p a c e s in your session names as they make automation a bit more difficult.
  • The source directory is the files that you will be backing up. Click the Open button to browse and select the root backup folder for the session.
  • The destination directory is your EVBackup account.
    For example, if your EVBackup account is bobsmith.evbackup.com, and you want to backup into the work-files folder on the server, then your destination will look like this:

    bobsmith@bobsmith.evbackup.com:work-files

Setting Session Options

Next, set the options that you'll need for your backup. Here's a few suggestions:

Basic Options tab:

  • ✓ Preserve time
  • ✓ Preserve permissions
  • ✓ Delete on destination (Use with caution!)
  • ✓ Verbose
  • ✓ Show transfer progress
  • ✓ Skip newer

Advanced Options tab:

  • ✓ Compress file data
  • ✓ Show itemized changes list
  • ✓ Protect remote args

Selecting Your SSH Key

Show Me
Adding your SSH private key to Grsync

Adding your SSH private key to Grsync

Next, select the SSH key that you created and uploaded previously so that you can login to your EVBackup account without a password. To select your SSH private key:

  1. Select the Advanced options tab in Grsync.
  2. Add -e "ssh -i /backup/private_key" into the Additional options box:

    For example, if your name is Bob Smith and you stored your private key in /backup, then the Additional options might look like this:

    -e "ssh -i /backup/private_key"

Step Four: Testing the Backup Session With a Simulated Backup

Show Me
Mking a simulated backup in Grsync

Mking a simulated backup in Grsync

Once you are configured, you'll want to do a simulated backup to make sure that everything is setup correctly. To simulate a backup session, select the Simulation option from the File menu.

  • If you see the files you expect to be backed up -- and you don't see any errors, then you are good to go!
  • If you need some assistance:

Once your simulated backup runs without errors:

  1. Go ahead and run your first backup: Click the Execute option from the File menu
  2. Save the session so you can automate it later.

Step Five: Automating Grsync Backups

Once you have your backup script created and saved, you need only to add a cron job to automate it. To automate a cron job for your script:

  1. At terminal, add a cron job for the superuser:

    sudo crontab -e

  2. Enter the daily schedule command for backup-web

    For example, to run backup-web every night at 11:42 PM, you would enter:

    42 23 * * * grsync -e backup-web

    • What are the crontab fields? »
    • « Hide this

    The fields in crontab (separated by s p a c e s or tabs) are:

    [minute] [hour] [day of month] [month] [weekday] [command] [command args]
    Use commas to designate a more than one value: 00,09,11,22
    Use hyphens to designate a range of values: 0-6

  3. Save your crontab file and close your text editor. You\'re all set!

Should you have questions or need help:

A Grsync simulation is a "dry-run" in rsync parlance.

Show rsync options will allow you to see the contents of your logs as you backup.

Showing the error list is useful for troubleshooting. If you have a problem, enabling this option will bring it to your attention.

Enable logging is crucial if you want Grsync to create detailed logs of each of your backup sessions.

Preserve time will copy the time stamps from your files up to the server.

Preserve permissions will copy the file permissions set on your local files up to the server.

Use with caution!

Delete on destination will remove a file from the server once it has been deleted locally. You might want to setup a separate session to run weekly to clean up deleted files on the the server.

The verbose option will give you detailed logs about your backup session. These can be written to your backup files for later reference.

Show transfer progress will show a transfer progress bar indicating how your backup session is progressing.

Skip newer is useful if you backup the same file from multiple locations. This option will not backup a file if a newer copy can be found on the server.

Compress file data will zip your files during transit. This makes backup times much faster.

Show itemized changes will print a detailed list of each file that has changed in your source directory.

MS Windows Users: You will need to enter -i into Additional options to use this feature.

Protect remote args will prevent accidental (and probably unintended) program execution from file and folder names that are also shell commands.

MS Windows Users: You will need to enter -s into Additional options to use this feature.