Grsync for Mac
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 on Mac OS X (Leopard /SnowLeopard)
Installation of Grsync is a snap:
- Download Grsync for Mac.
- Double-click the downloaded .dmg file.
- In the installer window, drage the grsync icon to the Applications folder icon.
Generating an SSH Keypair with ssh-keygen
To create SSH key pairs with Mac, you need only to enter a few commands into the
terminal. You'll want to run all of the commands here as the Mac OS X
'super-user' (root), so that you have full access to all the files on your machine.
To do this, we preface each command with sudo, as shown below.
Enabling Administrator Access
- Open the Control Panel and open Accounts.
- Select your username, and make sure that the Allow user to administer this computer is checked.
Creating the Key Pair
- To begin, open Terminal in Finder > Applications > Utilities.
-
Enter the following into Terminal to create a directory for backup files.
We recommend
/backup.sudo mkdir /backup -
To create the key, enter the following command into Terminal and press the Enter key:
sudo ssh-keygen -f /backup/ssh_key -t rsa -N ''Note: The command ends with two single quote characters.
Uploading Your Public Key to Your EVBackup Account
Next, you'll need to upload the public key to your EVBackup account. Enter the following into Terminal (all on one line):
sudo rsync -e ssh /backup/ssh_key.pub user@user.evbackup.com:ssh_keys/key1.pub
Notes:
- Substitute
userwith your EVBackup account name. - When you enter this command, you are going to see a message because your computer is being introduced to 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!
Activating Your Public Key
Next, you need to do is to activate your key on the EVBackup server. To do this, enter the following into Terminal:
ssh user@user.evbackup.com addkeys
The final thing that you need to do is test that you can login without a password. Enter the following into Terminal:
sudo ssh -i /backup/ssh_key user@user.evbackup.com
If you are 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 ~]$
Enter exit at the prompt and close Terminal. You're all set!
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
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
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"
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, then please let us know:
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.
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 grsync.app -e backup-web
For example, to run grsync.app -e backup-web every night at 11:42 PM, you would enter:
42 23 * * * open /Applications/grsync.app -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: