Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using Grsync with Ubuntu Presented by Dave Mawdsley, DACS Member, Linux SIG August 20, 2008 (making rsync easy with a memory key or a server)

Similar presentations


Presentation on theme: "Using Grsync with Ubuntu Presented by Dave Mawdsley, DACS Member, Linux SIG August 20, 2008 (making rsync easy with a memory key or a server)"— Presentation transcript:

1 Using Grsync with Ubuntu Presented by Dave Mawdsley, DACS Member, Linux SIG August 20, 2008 (making rsync easy with a memory key or a server)

2 What are rsync and Grsync? rsync is an open source utility run using a CLI (command-line interface) ‘terminal’ providing a fast, synchronized file transfer. rsync is freely available under the open source GNU GPL license. Wayne Davison is the current maintainer. Grsync is a GUI (Graphical User Interface) for rsync writing the required CLI command automatically. It makes use of the GTK libraries and is also released under the GPL license. While Grsync doesn't support everything in rsync’s options list, Grsync can effectively be used to synchronize local directories and supports remote targets in a limited way (read: manual). People may use grsync to synchronize their music files with removable devices or to backup files to a networked drive. It is made by OPByte Software. 1

3 How might rsync be used? Rsync might be used to make a directory backup from a computer to a memory key or external hard disk drive. ( no SSH needed ) Rsync might be used to make a directory backup from a computer to a server within a LAN (local area network). ( SSH required—the server presents a password screen ) ComputerRouter Server Computer Memory Key 2

4 Use Grsync with a Memory Key. If Grsync is not installed yet, open a terminal session and type the following: sudo apt-get install grsync Insert the memory key or external hard drive into the USB slot. Start Grsync from Applications > Internet in Ubuntu. Use the Browse buttons to locate the Source and Destination directories. Check the box for “Copy symlinks as symlinks.” Click on “Simulation” to test, and “Execute” to do the backup. Computer Memory Key 3

5 Use Grsync with the Memory Key. My computer had the following Source: /home/madmod/Documents/ My memory key had the following Destination: /media/disk/Documents/ Effectively Grsync used the following rsync command: rsync -r -t -p -o -v --progress /home/madmod/Documents/ /media/disk/Documents/ Computer Memory Key 4

6 5

7 Use Grsync with the Server. It’s assumed that Grsync is installed on the computer. OpenSSH has to be installed on both the computer and the server. To do this on each, open a terminal session and type the following: sudo apt-get install openssh-server At the session on the server, type ifconfig to identify the IP address of the server. Log into the router and set the server’s IP address in the static address table—so it’s location can be guaranteed with Grsync. ComputerRouter Server 192.168.1.10 192.168.1.4192.168.1.1 6

8 Use Grsync with the Server. Make sure that the server is running on the LAN. Start Grsync on the computer from Applications > Internet in Ubuntu. Use the Browse buttons to locate the Source and Destination directories. The Destination is a bit harder this time because it will include the server’s IP address. Below, click on the “Advanced Options” tab and in the box type: -e ssh (Note: in command mode it should be -e “ssh”) ComputerRouter Server 192.168.1.10 192.168.1.4192.168.1.1 7

9 Grsync to the Server from 192.168.1.4 Check the box for “Copy symlinks as symlinks.” Click on “Simulation” to test, and “Execute” to do the backup. My computer had the following Source: /home/madmod/Documents/ My server had the following Destination: 192.168.1.10:/home/madmod/MadMod-Laptop-Backup/Documents/ Effectively Grsync used the following rsync command: rsync -r -t -p -o -v --progress -l -e “ssh” /home/madmod/Documents/ 192.168.1.10:/home/madmod/MadMod-Laptop-Backup/Documents/ ComputerRouter Server 192.168.1.4 192.168.1.10 192.168.1.1 8

10 9

11 Using the Simulation Button 10

12 Pro’s and Con’s of Grsync & rsync Pro’s of Grsync: It’s easy to use and it has various options with a simple GUI. No coding of rsync is needed as Grsync does it all. Information about the sync or failure is given. Con’s of Grsync: It must be manually run from either a computer or a server. It applies only to folders. (a minor problem really) It applies only to static IP addresses inside a LAN. (also a problem with rsync) Pro’s of rsync: rsync has more capabilities than Grsync. rsync can be run as part of a Bash script or crontab job (scheduled command). Con of rsync: The coding is not intuitive and is unforgiving of mistakes. Reasons for errors are not given. The path to the folders is problematic. 11

13 Backup Script on 192.168.1.10 #!/bin/bash ############################################# # MadMod Computing 07/27/08 # # rsync Network Computers to the Server - # # Documents on MadMod-Desktop Computer # # Documents on MadMod-Laptop Computer # ############################################# clear # # Backup of Documents on the MadMod-Desktop Computer to the Server # Replace older files with newer ones; add new files and folders rsync -r -t -p -o -v --progress -l -e “ssh” 192.168.1.9:/home/madmod/Documents/ /home/madmod/MadMod-Desktop-Backup/Documents/ # echo " " # Backup of Documents on the MadMod-Laptop Computer to the Server # Replace older files with newer ones; add new files and folders rsync -r -t -p -o -v --progress -l -e “ssh” 192.168.1.4:/home/madmod/Documents/ /home/madmod/MadMod-Laptop-Backup/Documents/ # echo " " exit 0 12

14 Rsync Command Details rsync -r -t -p -o -v –progress -l -e “ssh” 192.168.1.10:/home/madmod/Documents/ /home/madmod/MadMod-Laptop-Backup/Documents/ -r [--recursive] recurse into directories. -t [--times] transfer modification times along with the files and update them on the remote system. -p [--perms] causes the receiving rsync to set the destination permissions to be the same as the source permissions. -o [--owner] preserve owner (super-user only) of the destination file to be the same as the source file, but only if the receiving rsync is being run as the super-user. Without this option, the owner is set to the invoking user on the receiving side. -v [--verbose] increase verbosity option stands for verbose and shows you what’s going on. -l [--links] copy symlinks as symlinks. -e “ssh” invoke ssh with login on the remote computer. 13

15 Concluding Remarks Syncing with rsync or Grsync means that newer same-named files overwrite older ones, while new files and sub-folders are copied to the destination. Grsync has a feature to exclude unwanted folders from the synchronization. Grsync has a feature that allows actions to occur just before the sync. Restoring folders from a backup is about as simple as reversing the source and destination in Grsync. Grsync has a reverse feature—to swap the two. rsync has an extensive man page which shows the many features it is capable of. Excluding folders from the rsync command is also possible and useful. rsync doesn’t have a simulation mode as far I know. So practice with unimportant folders first. Make sure that the sync works properly, then substitute the paths and folders that should be used. Restoring folders from a backup requires reversing the source and destination folders in rsync. Be sure to put a single space between them in the rsync command. Rsync is ideal for inclusion in a Bash script with many tasks to do. Crontab allows for automated timed/dated rsync commands. (another topic) Ubuntu has a backup and restore scheme must be manually run from either a computer or a server. The backup uses a tar archive that is a full backup rather than a sync. Full backups can take lots of time. Syncs are very quick. 14

16 Login required from 192.168.1,10 15

17 Screenshot of my server's desktop using vncviewer from my notebook's desktop

18 Concluding Remarks Screenshot of my notebook's desktop

19 Using Grsync with Ubuntu This OpenOffice.org Presentation 'grsyncub.odp' can be downloaded from http://madmod.com/freebies.html (making rsync easy with a memory key or a server)


Download ppt "Using Grsync with Ubuntu Presented by Dave Mawdsley, DACS Member, Linux SIG August 20, 2008 (making rsync easy with a memory key or a server)"

Similar presentations


Ads by Google