![]() Now on our local machine (Mint) we issue the following command: In the next example we are going to copy a local file to our remote "CentOS" machine.įor this example, we have added a new file called mint_file.txt into our current ls -l Copying a local file to a remote server with rsync This time the " time stamp" information has been preserved and should match that of the original files from the remote "CentOS" machine. Sent 149 bytes received 327 bytes 136.00 bytes/sec Rsync -vt -e ssh rsync -vt -e ssh password: If we wanted to preserve this time stamp, then we can modify our command to include the " -t" option to preserve our time stamp information: Notice, the files that have been copied have a different time stamp to the original files on the remote "CentOS" machine. If we now issue the " ls -l" command on our local machine we should see that the files have been transferred ls -l Once authenticated, our files should be copied to our local machine in our current directory. Sent 119 bytes received 1,357 bytes 328.00 bytes/secįirst we will be asked to supply a password for the remote machine. ![]() " after the remote directory location specifies to copy to the current directory on the local rsync -v -e ssh password: This command will copy the files from the remote "CentOS" machine to our local directory. On our local machine " Mint" we are going to issue the command: " CentOS" has the following files in its directory: " Mint" currently has no files in the directory below: In the following example we are going to use our local machine "Mint" and our remote machine "CentOS": The following rsync command retrieves files from a remote location to a specified directory. Grsync is basically a front end to the "rsync" command and is available within most repositories.īelow are examples of some basic uses of the " rsync" command for copying files: Retrieving files from a remote host with rsync An example of a GUI rsync tool is " Grsync". Many tools are also available with a GUI (Graphical User Interface) that allow you to configure backups quickly. Rsync is generally run from a command line or from within a script which makes it ideally suited for making backups. The rsync tool locates files that need to be transferred using a " quick check" algorithm that looks for any files that have changed in size or changes in the last-modified time. This makes rsync extremely useful as a backup tool. Rsync is known for its " delta-transfer" algorithm which reduces the amount of data transferred over a network by sending only the differences between the source files and the existing files in the destination. Rsync has a vast set of options that allow you to control virtually every aspect of its behaviour and the way files are copied. Rsync can copy locally, to and from another host over any remote shell, or to and from a remote rsync daemon. Rsync is a fast and powerful file copying tool.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |