For example, there is a folder in your local computer “ rpmpkgs” that contains some RPM packages and you want that local directory’s content sends to a remote server, you can use the following command. This command will sync a directory from a local machine to a remote machine. Copy/Sync Files and Directory to or From a Server Copy a Directory from Local Server to a Remote Server Sent 3.47M bytes received 96 bytes 2.32M bytes/sec ]# rsync -avzh /root/rpmpkgs /tmp/backups/ Here in this example, /root/rpmpkgs contains some rpm package files and you want that directory to be copied inside /tmp/backups/ folder. The following command will transfer or sync all the files from one directory to a different directory in the same machine. Rsync Local Files Copy/Sync a Directory on Local Computer In the above example, you can see that if the destination is not already existed rsync will create a directory automatically for the destination. Sent 224.54K bytes received 70 bytes 449.21K bytes/sec Here in this example, a file name backup.tar needs to be copied or synced to /tmp/backups/ folder. ![]() The following command will sync a single file on a local machine from one location to another location. Copy/Sync Files and Directory Locally Copy/Sync a File on a Local Computer ![]() We can install the rsync package with the help of the following command in your Linux distribution. -h : human-readable, output numbers in a human-readable format.-a : archive mode, which allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships, and timestamps. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |