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:
- Download the Grsync package most appropriate for your platform.
- 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
-
Note the command ends with two single quote characters.
sudo ssh-keygen -f /backup/ssh_key -t rsa -N ''
- 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.pubssh user@user.evbackup.com addkeysShow Me
- Notes about uploading »
- « OK. Hide this
- Substitute
userwith 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
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
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 isbobsmith.evbackup.com, and you want to backup into thework-filesfolder 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
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:
- Select the Advanced options tab in Grsync.
- 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
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:
- Go ahead and run your first backup: Click the Execute option from the File menu
- 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:
- At terminal, add a cron job for the superuser:
sudo crontab -e - 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:
Use commas to designate a more than one value:[minute] [hour] [day of month] [month] [weekday] [command] [command args]00,09,11,22
Use hyphens to designate a range of values:0-6 - Save your crontab file and close your text editor. You\'re all set!
Should you have questions or need help: