Explore information related to rsync examples


Use Rsync on your Ubuntu 20.04 Linux system - Step by step guide ?

This article covers the basics of rsync command, how to transfer and sync files locally as well as remotely. In fact, Rsync is the most efficient, accessible, and secure ways to sync files between operating systems and servers.


How to Install Rsync On Linux System ?

1. Install Rsync Alma Linux, Fedora, Rhel, Rocky Linux based distributions:

$ sudo yum install rsync -y

2. Install Rsync Debian, Linux Mint, Ubuntu based distributions:

$ sudo apt install rsync -y


Rysnc Commands includes:

  • -a, –archive: archive files and directory while synchronizing ( -a equal to following options -rlptgoD)
  • -b, –backup : take the backup during synchronization
  • -l, –links: copy symlinks as symlinks during the sync
  • -d, –delete: deletes extraneous files from the destination location.
  • -e, –rsh=COMMAND: mention the remote shell to use in rsync
  • -h, –human-readable: display the output numbers in a human-readable format
  • -u, –update: don't copy the files from source to destination if destination files are newer
  • -r, –recursive: sync files and directories recursively
  • -n, –dry-run : perform a trial run without synchronization
  • –p, –progress: show the sync progress during transfer
  • -z, –compress: compress file data during the transfer
  • -q, –quiet: suppress message output
  • -v, –verbose : verbose output

Read More



Preserve Permissions in rsync

This article will guide you on how to use rsync to preserve permissions. 

Rsync, or Remote #Sync, is a free command-line tool that lets you transfer files and directories to local and remote destinations. #Rsync is used for mirroring, performing backups, or migrating data to other servers.

a = archive - means it preserves #permissions (owners, groups), times, symbolic links, and devices. Use of "/" at the end of path: When using "/" at the end of source, rsync will copy the content of the last folder.

To preserve permissions when files and folders are copied or moved, use the Xcopy.exe utility with the /O or the /X switch. 

The object's original permissions will be added to inheritable permissions in the new location.

To make rsync to preserve timestamps:

1. To overcome this, there is another option that you can specify in the rsync command that will preserve the timestamps during the synchronization process. 

2. Without preserving the timestamp, the files will display the modification date and time as the time that the rsync command was run.

Read More



Process to rsync only new files in Linux

This article will guide you on the steps to #transfer only the new files using rsync locally and from Local to #Remote #Linux.

Syncing to a remote system is trivial if you have SSH access to the remote #machine and #rsync installed on both sides. Once you have #SSH access verified between the two machines, you can #sync a folder to a remote #computer by using the rsync syntax.

Read More




For Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on LinuxAPT.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com