Home Rsync Grsync – A Simple Graphical Frontend For Rsync

Grsync – A Simple Graphical Frontend For Rsync

By sk
7.9k views

Undoubtedly, Rsync is a powerful backup application to synchronize and backup files and directories in Linux and Unix-like operating systems. Since Rsync is a command line utility, many newbies may find it difficult to use. Fortunately, there are a few graphical frontend tools for Rsync available. In this guide, we will discuss one such tool named Grsync.

What is Grsync?

Grsync is a simple GTK graphical front-end application for Rsync command line utility. Using Grsync, you can easily backup, transfer, synchronize files and folders within the local system or between a local and remote systems.

No need to memorize Rsync commands. You can do everything via Grsync graphical user interface!

Grsync also allows you to backup local files to a removable device or a networked drive/share, replicate a partition to another one and mirroring files.

It supports most important features of Rsync. If you're a noob who is looking for a easy-to-use, and also a robust backup solution for your Linux desktops, Grsync is a good choice!

Grsync is a cross-platform application that supports GNU/Linux, macOS and Windows.

Install Grsync in Linux

Grsync is packaged for popular Linux operating systems.

To install Grsync in Arch Linux and its variants such as EndeavourOS, Manjaro Linux, run:

$ sudo pacman -S grsync

Grsync is also available in AUR, so you can install it on a Arch Linux based systems using a AUR helper tool such as Paru or Yay like below:

$ paru -S grsync

Or,

$ yay -S grsync

Install Grsync in Debian, Ubuntu, Linux Mint, Pop_OS!:

$ sudo apt install grsync

Install Grsync in Fedora:

$ sudo dnf install grsync

Install Grsync in openSUSE:

$ sudo zypper install grsync

We can also install Grsync from source. Go to the Grsync official download page, get he latest tar file and then compile and install as the way you install packages from source.

In most Linux distributions, Grsync can be installed by using ./configure && make command. You may need to install gtk and autotools in order to compile Grsync from source. Refer the Grsync website given at the end for more details.

Grsync interface

Once installed, Launch Grsync from Application launcher or Menu. The default interface of Grsync should look like below:

Grsync default interface
Grsync default interface

As you can see in the above screenshot, Grsync interface is very simple!

Create new sessions

You can create any number of sessions and choose different options for each session. Sessions are useful when you wanted to schedule backups and also perform different type of backups.

For instance, you can create distinct sessions for local backup, remote backup and synchronization etc.

By default, Grsync includes a predefined session called "default". In the default session, only a few options are enabled and they are safe to use.

Create, delete sessions in Grsync
Create, delete sessions in Grsync

Grsync options

Most options are self-explanatory. Just hover the mouse cursor on any option, you will see a brief description of the chosen option in a small pop-up.

There are three sections in Grsync main window. They are:

  1. Basic options,
  2. Advanced options,
  3. Extra options.

1. Basic options

In the Basic options section, you can enter the source and destination file/folder paths. In addition, you can configure the following options as well:

  • Preserve time, permissions, owner and group.
  • Delete files in the destination which are not present in the source.
  • Show verbose output.
  • Ignore files which already exist in the destination.
  • Do not update newer files.
  • Do not cross filesystem boundaries.
  • Show progress bar during file transfer.
  • Check size only, ignore time and checksum.
  • Windows compatibility.

2. Advanced options

In the Advanced options section, you can choose the following options:

  • Always compare file contents by checksum.
  • Preserve devices.
  • Keep partially transferred files.
  • Copy symlinks as symlinks i.e. copy Symlinks, but do not copy link target file.
  • Create backups of existing files in the destination.
  • Disable recursion.
  • Compress file data when transferring.
  • Only update existing files.
  • Keep numeric uid/gid instead of mapping user names and group names.
  • Copy hardlinks as hardlinks i.e. copy hardlinks, but do not copy link target file.
  • Show addition information on every changed file.
  • Protect remote arguments from shell expansion.

3. Extra options

From the Extra options section, we can choose the following options:

  • Execute a command before or after rsync.
  • Don't run rsync and halt it, when the command that is executed before rsync fails for some reason
  • Execute "after" command only if synchronization had errors.
  • Browse files instead of folders.
  • Run Rsync with super user or root privileges.

If you don't understand what each option does, just go with the defaults. The default selections are safe!

To avoid data loss, start with a dummy backup and test all the options one by one to verify how Rsync behaves. Once you clearly understood what each option does, go ahead and backup your important data with Grsync.

Copy or backup files and folders locally

Enter your source and target paths under the Source and Destination section.

Copy or backup files and folders locally
Copy or backup files and folders locally

Here, I am going to backup the contents of /home/sk/Downloads/Ostechnix/ (Source) to /home/sk/Documents/Local backup (destination) directory. Check all the required options in the Basic, Advanced and Extra options' sections.

Heads Up: Here, the trailing slash (/) plays an important role.

If you want to transfer a directory contents (but not the directory itself) to another directory, make sure you have specified the trailing / at the end of the source directory like below:

$ rsync -av path/to/source_directory/ path/to/destination_directory

A trailing slash on the source directory avoids creating an additional directory level at the destination.

To transfer a directory itself and all its children from a one one directory to another:

$ rsync -av path/to/source_directory path/to/destination_directory

Please note that I didn't add the trailing / at the end of the source directory in the above command. This will copy the whole source directory to destination.

Before running the actual backup, it is recommended to do a dry run. It will simply show what would have been done, but actually do nothing! By performing dry run, you can witness what is going to happen in background while running a task, without running the actual task.

Perform dry run in Grsync
Perform dry run in Grsync

Alternatively, you can perform dry run from File -> Simulation or press Alt+S keys.

Perform dry run from file menu in Grsync
Perform dry run from file menu in Grsync

A simulation will take place now. In the simulation, you will see what is going to happen after running the actual backup.

Launch Rsync in simulation mode
Launch Rsync in simulation mode

If the backup process is completed as intended, click the Run button to do start the actual backup.

Backup files and folders locally with Grsync
Backup files and folders locally with Grsync

Now the files and folders from the given source directory will be copied to the destination directory.

Backup completed
Backup completed

Transfer files and folders from local system to remote system

In the previous section, we've seen how to backup files and folders from one location to another in the same system itself. Now, we will see how to synchronize or transfer files/folders from one system to another.

For the purpose of this guide, I will be using the following two Linux systems.

Local system:

  • OS - Fedora 34 desktop
  • Source directory - /home/sk/Downloads/Ostechnix/

Remote system:

  • OS - AlmaLinux 8 server
  • User - ostechnix
  • IP adrress - 192.168.122.143/24
  • Destination directory - /home/ostechnix/Backup/

Now, I am going to backup the contents of /home/sk/Downloads/Ostechnix/ (Source) in Fedora desktop to /home/sk/backup (destination) directory in AlmaLinux 8.

First, create a new session by clicking on the plus (+) sign from the tool bar on the top right corner. You can also do it from Menu -> Sessions -> Add or press Alt+A. Name your new session. For example, I named it as Remote sync.

Create new session in Grsync
Create new session in Grsync

Enter the source and destination paths in the respective columns:

Enter source and destination paths
Enter source and destination paths

Make sure you have entered the correct path with correct format in Destination column like below:

ostechnix@192.168.122.143:/home/ostechnix/Backup

Here, ostechnix is my remote username, 192.168.122.143 is my remote system's IP and /home/ostechnix/Backup is the destination directory. Replace the username, IP address and the destination path with your own.

If you want to verify if you've chosen the correct options, you can perform a dry run by clicking the light bulb icon in the tool bar or go to Menu -> File -> Simulation.

If everything goes as intended, click the execute button on the tool bar to start the actual file backup/transfer. You can also start the backup from File -> Execute.

Transfer files and folders from local system to remote system
Transfer files and folders from local system to remote system

You will be prompted to enter the remote user's password and click OK to transfer files.

Enter remote user password
Enter remote user password

Upon successful file transfer, you will see a message like below.

File transfer completed
File transfer completed

You may see this error - Failed to load module "pk-gtk-module". You can safely ignore it. It has nothing to do with Grsync. Despite this minor error, Grsync is successfully transferred files from source to destination system.

To get rid of the Failed to load module "pk-gtk-module" error, install the following package:

$ sudo dnf install PackageKit-gtk3-module

Verify backups

To verify if backups are successfully taken, go to the destination (in our case it is AlmaLinux remote system) and compare the contents of destination directory with source's contents.

Verify backups
Verify backups

Contents from both locations should be same.

Synchronize files and folders

To synchronize files and folders between two local directories or local and remote systems, check the box that reads - Delete on destination. This will delete files in destination that are not in present in source.

Synchronize files and folders with Grsync
Synchronize files and folders with Grsync

This will keep exact replica on both source and destination locations.

Please note that you must manually enter the remote user's password every time. If you want to automate the schedule jobs without any user interaction, setup password-less SSH access as described in the following link:

Schedule backups

Grsync doesn't have any dedicated option to enable scheduled backups. However, we can use Cron to automate backups at particular interval.

Edit the current user's cron jobs using command:

$ crontab -e

Add the following lines at the end:

0 3 * * * grsync -e "default"
0 4 * * * grsync -e "Remote sync"

This will Grsync default session every day at 3 am and Remote sync session every day at 4 am. Replace the session names with your own. Save and close the file.

If you're new to Cron, refer the following guide for more Cron job examples.

Please note that you must setup SSH password-less authentication to schedule backups automatically at regular interval.

Conclusion

In this guide, we discussed what is Grsync, and its features and how to copy or backup files/folders within local system and transfer or synchronize files/folders between local and remote systems using Grsync. If you're looking for a robust and secure way to backup your data, Rsync and its graphical front-end Grsync will definitely help.

Resource:

You May Also Like

1 comment

Jalal Hajigholamali August 11, 2021 - 2:13 pm

Hi,
Thanks a lot
very useful article

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More