![]() If this is the case, rsync provides an option to define the new port. There are cases when some service providers change their SSH ports for security reasons. Let's perform the above example, however, let's use a remote server on which to transfer the backup: rsync -aHvz /home/user/public_html/ :/backups/website-backupīy default, rsync is going to use OpenSSH service to transfer the files, as it is the most secure channel. z - adding this option is going to compress the transferred data, reducing the amount of bandwidth transmitted.Ĭopy files/directories in a remote environment.v - adding this is going to provide more information while the sync is ongoing.H - adding this option is going to preserve hard links.The archive mode preserves all file permissions, ownerships and modification times of files and folders. a - adding this option is going to enable " archive mode".Now, let's go over the options we use for this command: ![]() The trailing slash at the destination does not change the outcome of the sync process. If the trailing slash is not placed there, rsync is going to create the " website-backup" folder, and then it is going to copy the " public_html" directory with all its files inside. Please notice the trailing slash at the source. Here is the command you can use: rsync -aHvz /home/user/public_html/ /backup/website-backup The backups are stored in the "/backup" global directory. On a cPanel server, the primary domain name's files are located within the " public_html" directory inside the home dir of the user. Using rsync, you can easily create backups of your website by copying the files from its root directory to a folder designated for backup storage. The most basic syntax of the command is as follows: rsync Copy files/directories in a local environment We are going to cover only a few examples in this article, which can hopefully teach you the fundamentals of this command-line utility and help you accomplish your goals. Additionally, it uses the " delta-transfer algorithm" that reduces the amount of bandwidth transferred over the network by sending the difference between the source and the destination files only. What makes it so great is the large number of options, allowing control over its behavior, which enables you to tune it to your needs. ![]() Mastering this command is going to help you effectively transfer data across different servers or generate and restore backups. Rsync ( Remote Sync) is an exceptionally versatile tool for copying and synchronizing files/directories in local or remote environments.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |