This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Some advanced features

There are a few more or less advanced features in RsyncUI. If you are new to RsyncUI, new to rsync, it is adviced to learn the basics before utilizing the more advanced features.

Halting tasks

By right-clicking on a task, on column Synchronize ID or Task, it can be halted or released from halted status. A halted task will be marked and not available for estimate or execute. When releasing a task from halted status, it remember which kind of task it was before halted.

1 - URL commands

Deep links facilitate direct access to application features via URL links. By utilizing deep links, users can execute an estimate and synchronize actions in a single click. Deep links in RsyncUI enable the grouping of actions that typically require multiple user inputs.

There are three methods of using deep links:

  • enable RsyncUI widgets
  • use URL functions direct within RsyncUI
  • save an URL-link in e.g. Notepad

RsyncUI widgets

Two widgets are embedded in RsyncUI:

  • one for estimating and synchronizing
  • and the second for verifying remote repository

Both widgets retrieve a saved URL link from storage. Within the Tasks view, there is a view for URLs. Within this view, you can save the required URLs. The widgets display whether a validated URL is present. To enable the widgets on macOS, click on the date and time icon located in the upper right corner of your screen. Edit the widgets and select RsyncUI. Then, add the widgets.

After enabling the widgets, a single click on the widget will launch RsyncUI and execute the corresponding action. To modify the URLs, update and save the new URLs.

Execute URL´s from within RsyncUI

Deep links also enable automation of actions within RsyncUI. A single click on the toolbar icon executes the URL action. RsyncUI generates the necessary URL based on the loaded profile and the required action. The two yellow toolbar icons allow execution of URL commands from within RsyncUI, as demonstrated in section above.

URL´s and Notepad

URL´s must start with rsyncuiapp://. The two URL´s actions are:

ActionURL
Estimate all tasks, automatically synchronize datarsyncuiapp://loadprofileandestimate?profile=Pictures
Verify a taskrsyncuiapp://loadprofileandverify?profile=Pictures&id=Pictures_backup
  • Estimate all tasks and automatically synchronize data
    • load profile, estimate all tasks and automatically synchronize data
  • Verify task, as an example, with Synchronize ID=Pictures backup
    • load profile and verify task with synchronizeID=Pictures backup*, the space in synchronize ID on task is converted to _ when searching for task in RsyncUI

There is a count down in six seconds to abort the synchronize task after estimate. The count down may be bypassed by toggle switch in Settings view.

Note: If only the default profile is in use, parameter is profile=default

Note: If there is space in Synchronize ID, like “Pictures backup”, the URL-parameter is id=Pictures_backup. RsyncUI automatically replaces the _ with space when searching for the ID.

View URLs

You may copy the correct URLs and save the URLs in e.g Notepad for easy access to start a synchronize task.

If RsyncUI encounters an invalid URL link, it will generate errors. Only well-defined URLs (specifically those supported by RsyncUI) are processed and executed. All URLs are validated as valid, but only defined URLs for RsyncUI are actually executed.

2 - Verify remote

Typically, a synchronize action operates in a one-way direction of data. Local data is synchronized to a backup media, such as an attached disc or a remote server. Restoring data, for instance, involves retrieving data from a backup when local data has become corrupted or inaccessible.

If you are using multiple Macs, as I do, and all Macs synchronize data to the same remote storage, there may be challenges maintaining synchronization and preventing data loss, particularly if the remote storage is not a Git server, such as GitHub and Gitea. If the remote destinations are stored on a Git server, regular git push and pull commands will suffice.

Git is a superior tool for version control. However, in certain situations, creating a Git repository may not be feasible, and this function may prove useful. As a reminder, the Verify function is designed for multiple Macs synchronizing data to a single remote server as a backup. It also assists in deciding whether to push or pull changes to keep the local repository updated.

The verification applies only to remote destinations on servers

Synchronization of Multiple Macs to a Remote Server

I have over 3,000 bird photos (130 GB) from the past four years that are synchronized using RsyncUI to a local remote server at home. New photos are added, old photos are deleted, and updates are made to sidecars of the photos. As long as I was using only one Mac, all updates were made on that Mac. However, with two Macs, I now use both Macs to work on my photos. When I synchronize my changes, I need to transfer those changes to my second Mac.

Arguments for rsync

The following arguments are used in both push and pull.

  • --itemize-changes - output change-summary for all updates
  • --dry-run - rsync execute an estimate run
  • --update - evaluates the timestamp

The result from the pull command is subtracted from the result of the push command. Conversely, the push command is subtracted from the result of the pull command. After both subtractions, the resulting arrays are compared based on the number of rows.

The outcome is as follows:

  • If pull has more data than push, it is likely that the remote repository is more up-to-date than the local repository.
  • If push has more data than pull, it is likely that the local repository is more up-to-date than the remote repository.
  • If the number of rows is equal, it is likely that the local repository is more up-to-date than the remote repository.

If there are zero rows, most likely, local and remote repository are in sync.

Itemized output - push or pull

The parameter -i or --itemize-changes produces details about each file. The format of the output is:

YXcstpoguax
|||||||||||
`-------------------------- the TYPE OF UPDATE:
 ||||||||||   <: file is being transferred to the remote host (pushed).
 ||||||||||   >: file is being transferred to the local host (pulled).
 ||||||||||   c: local change/creation for the item, such as:
 ||||||||||      - the creation of a directory
 ||||||||||      - the changing of a symlink,
 ||||||||||      - etc.
 ||||||||||   h: the item is a hard link to another item (requires --hard-links).
 ||||||||||   "+" - the file is newly created
 ||||||||||   .: the item is not being updated (though it might have attributes that are being modified).
 ||||||||||   *: means that the rest of the itemized-output area contains a message (e.g. "deleting").
 ||||||||||
 `----------------------------- the FILE TYPE:
  |||||||||   f for a file,
  |||||||||   d for a directory,
  |||||||||   L for a symlink,
  |||||||||   D for a device,
  |||||||||   S for a special file (e.g. named sockets and fifos).
  |||||||||
  `--------- c: different checksum (for regular files)
   ||||||||     CHANGED VALUE (for symlink, device, and special file)
   `-------- s: Size is different
    `------- t: Modification time is different
     `------ p: Permission are different
      `----- o: Owner is different
       `---- g: Group is different
        `--- u: The u slot is reserved for future use.
         `-- a: The ACL information changed

RsyncUI indicates remote is more updated. However, this is merely an advisory. I must verify this independently to ensure my certainty.

3 - Passwordless login

To synchronize data to a remote server using RsyncUI, passwordless login via SSH-key authentication is required. It is not possible to provide a user login and password during data synchronization via RsyncUI. SSH-key authentication is generally considered more secure than password-based authentication.

If default values for RSA-based SSH-key authentication are used, no additional information about the SSH-key is required in RsyncUI. However, it is necessary to provide information if custom SSH-keypath, identityfile, or port number is used.

The SSH-keypath and identityfile are specified as follows:

-e "ssh -i ~/.keypath/identityfile -p NN"

where:

  • -i ~/.keypath/identityfile is the SSH-keypath and identityfile
  • -p NN is the port number used for communication (default port 22)

To use my own SSH-key and SSH-keypath data, the following is added to RsyncUI in the settings:

To configure SSH-keypath and Identityfile, refer to the user configuration located in the SSH settings. When enabling user-selected SSH-keypath and Identityfile, please ensure they adhere to the following format:

~/.mynewsshcatalog/mynewkey

like

~/.ssh_rsyncosx/rsyncosx

The prefix must be ~ followed by a /. RsyncUI will verify that the SSH-keypath begins with ~ and contains at least two / characters before saving the new SSH-keypath.

The rsync command to synchronize my Documents catalog is set by RsyncUI to my Raspberry Pi server:

/opt/homebrew/bin/rsync --archive --verbose --compress \
-e "ssh -i ~/.ssh_rsyncosx/rsyncosx -p 22" --stats \
/Users/thomas/Documents/ thomas@raspberrypi:/backups/Documents/

For more information on passwordless login, please refer to the Tools passwordless login section.

4 - Tools passwordless login

The following SSH tools are utilized: ssh-keygen and ssh-copy-id. RsyncUI primarily assists in establishing an RSA-based key.

The SSH functions facilitate two methods:

  • private and public SSH-key pairs based on default SSH values for RSA keys (~/.ssh/id_rsa)
  • private and public SSH-key pairs based on user-selected values (~/.ssh_rsyncosx/rsyncosx)

If creating a new public SSH-key pair based on default SSH values for RSA keys, RsyncUI does not add any parameters to the rsync command because these are default values. SSH parameters are added to the rsync command only when the second method is selected.

The following commands for creating a new, alternative private and public SSH-key pair are provided:

cd
mkdir .ssh_rsyncosx
ssh-keygen -t rsa -N "" -f ~/.ssh_rsyncosx/rsyncosx

where:

  • -t rsa "" generates a RSA-based key pair
  • -N "" sets no password
  • ~/.ssh_rsyncosx/rsyncosx is set by the user

The following command copies the newly created public key to the server:

ssh-copy-id -i /Users/thomas/.ssh_rsyncosx/rsyncosx -p NN user@server

The user can also configure the new SSH keypath and identityfile in a terminal window and subsequently add them to the Userconfig. RsyncUI will automatically enable these settings when added to the Userconfig.

The user can also apply local SSH keypath and identityfile and SSH port, which govern global settings, to each task.

Ensure that the new SSH catalog has the appropriate permissions. Open a terminal window and execute the following command:

chmod 700 ~/.ssh_rsyncosx

5 - Export and import

Tasks can be exported and imported between profiles and to new Macs. Select the “File” menu and then choose “Export and import.”

6 - Snapshots

In every snapshot task, RsyncUI stores the next available snapshot number for use. The snapshot number is a sequential number incremented by one after each snapshot task execution. The rsync command automatically creates the next snapshot catalog by number and stores the next snapshot number to use on the task. The snapshot number is displayed as part of the log timestamp.

If a file named “file.txt” is saved in the initial snapshot and remains unchanged or deleted, the file “file.txt” in the latest snapshot is a hardlink to the original file in the first snapshot.

If the “file.txt” is deleted from the initial snapshot, the filesystem handles the update and determines the appropriate location to save the original file as part of the delete operation.

In RsyncUI, even if all snapshots are marked for deletion, the first and last snapshots are not deleted.

Definition of a Snapshot:

A snapshot is a saved state or backup of data at a specific point in time. Each snapshot is synchronized with the local catalog at the time of creation.

Previous versions of files can be restored from a snapshot using the --link-dest parameter with rsync.

Remote server

The rsync parameter for next snapshot to synchronize to a remote.server is:

--link-dest=~/snapshots/n-1 /Users/thomas/data/ user@remote.server:~/snapshots/n

where

  • n is the number of next snapshot to be synchronized
  • n-1 is the latest synchronized snapshot
  • /Users/thomas/data/ is the source catalog, only read by rsync
  • ~/snapshots/ is the destination catalog where snapshots are synchronized
Local attached disc

The above with a local attached disc, mounted as /Volume/backup is:

--link-dest=/Volume/backup/snapshots/n-1 /Users/thomas/data/ /Volume/backup/snapshots/n

where

  • n is the number of next snapshot to be synchronized
  • n-1 is the latest synchronized snapshot
  • /Users/thomas/data/ is the source catalog, only read by rsync
  • /Volume/backup/snapshots/ is the destination catalog where snapshots are synchronized
Snapshot Creation

To create a snapshot task, select “snapshot” as the action in the Add tasks section. Do not copy and paste the command for execution within a terminal window. RsyncUI automatically saves the snapshot number “n” to the task. This number represents the next available snapshot number and is used to calculate the rsync parameter. The value of “n” is retrieved from the configuration.

Snapshot Administration

Snapshot administration is crucial to maintain an organized and efficient backup system. It involves deleting unnecessary or irrelevant snapshots to prevent clutter and simplify the management of the backup space. Regularly reviewing and deleting snapshots is essential to ensure that only the most relevant data is retained.

Deleting Snapshots

Deleting snapshots is a destructive operation that should be performed with caution. It is important to have a plan in place to determine which snapshots to keep and which to delete. RsyncUI provides a simple plan for deleting and keeping snapshots.

The Plan for Keep and Delete

Selecting the “Tag” button evaluates all snapshots based on the date within the log record. Based on the selected plan and date, snapshots are either tagged with “keep” or “delete.” Snapshots tagged with “delete” are also preselected for deletion. To delete the marked snapshots, select the “Delete” button.

Even if all snapshots are tagged for deletion, the first and last snapshots are not deleted. The first and last snapshots are removed from the delete list as part of the internal preparation for deletion.

The plan is based on three parts, where the parameter plan has an effect on previous months (and years):

  • the current week
    • keep all the snapshots within the current week
    • value of plan has no effect on the current week
  • the current month minus the current week
    • keep all snapshots for the selected Day of week, e.g all snapshots every Sunday this month
    • value of plan has no effect on the current month
  • previous months (and years)
    • keep the snapshot in the last week of month for selected Day of week, e.g the last Sunday in the month
    • if plan == Every, keep for the selected Day of week, e.g all snapshots every Sunday, every week in previous period
    • if plan == Last, keep for the selected Day of week, e.g all snapshots every last Sunday every month in previous period

Tagging and Deleting Snapshots

It is recommended to optimize the number of snapshots. Select a plan, tag the snapshots, and delete the snapshots marked for deletion.