Synchronizing the Filesystems

Table 1. Feature History Table

Feature Name

Release Information

Description

Synchronizing Filesystems

Release 7.3.4

This feature helps you to synchronize filesystems, by using a utility called Rsync. Instead of transferring the complete file, Rsync transfers only the changes in the files.

Overview of Filesystem-Synchronization

A filesystem is a data structure and method, where files and data are named and stored logically and retrieved by the operating systems. Typically, filesystems have files and filenames, directories, metadata, utilities, and so on.

For synchronizing filesystems, Cisco IOS XR uses a utility that is called Rsync. Rsync helps in transferring and synchronizing files between two filesystems. It can be between a computer and an external hard drive or across networked computers. Rsync compares the modification time and the size of files, and transfers only the changes in the files. In secure copying (scp) or any other synchronizing methods, the process transfers the complete file.

You must be a privileged user to run the Rsync tool.

Rsync is enabled by default in Cisco servers and is supported only on Cisco IOS XR software.

You cannot disable Rsync.

Synchronize Files and Directories

You can copy or synchronize files and directories in local and remote servers.

Linux clients support the following command for copying and synchronizing the files and directories with the router:

Rsync <filename/dir name> <user>@<ip>:<path>

If the file transfer fails, an error message appears on the screen. Following are a few examples of the error messages:

rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]

rsync: --lock: unknown option
rsync error: syntax or usage error (code 1) at main.c(1567) [client=3.1.2]

rsync error: unexplained error (code 255) at rsync.c(638) [sender=3.1.2]
rsync: [sender] write error: Broken pipe (32)

To restore directories to its previous state, you can use the Linux commands. For example: rsync -avz --delete dir-A.bak/ dir-A/

Verifying the File Transfer

Use the --checksum parameter to verify the file synchronization:
rsync -av -r --checksum --delete --timeout=600 {source_path} {username}@{ipaddress}:{destination_path}

Configuration Examples for Synchronizing Filesystems

The following example shows the command to transfer a file using the Rsync utility:
rsync -v sim-config.xml admin@192.0.2.3:/harddisk:/
Warning: Permanently added '192.0.2.3' (ECDSA) to the list of known hosts.
Password:
sim-config.xml

sent 907 bytes received 35 bytes 110.82 bytes/sec
total size is 812 speedup is 0.86
The following example shows the command to verify the transferring of files:
rsync -av -r --checksum --delete --timeout=600 rsync_temp/ admin@192.0.2.3:/harddisk:/
Password:
sim-config.xml

sent 907 bytes received 35 bytes 110.82 bytes/sec
total size is 812 speedup is 0.86