Tag Info

New answers tagged

0

I'm agreed that a simple mv could be enough, but rsync is providing a lot more tools to make what you want to do. For example, when I'm using rsync to move files across filesystem I must keep the owner rights, group, mtime, etc... And Rsync is a tool which provides you all of this easily. Indeed of course, for larges directories, benchmarking is a must for ...


2

There are at least a couple of ways to solve this issue. But first let me try and explain how the Linux/Unix world of permissions corresponds to the Windows world. windows has inheritable permissions; Linux systems traditionally don't (but can with ACLs, which I'll ignore for now). Linux permissions are split in to three: owner, group, and everyone else ...


0

You can use RAID-1 (mirroring) for optimizimg this. This is getting strange with changed made to both sides but that makes using rsync strange, too. You should explain how this is to be handled. You can create a file (dd if=/dev/zero of=/path/to/syncfile.img bs=1M count=3500) which is a bit bigger than what your sync file will grow to in the near future. ...


3

Rsync will not use deltas but will transmit the full file in its entirety if it - as a single process - is responsible for the source and destination files. It can transmit deltas when there is a separate client and server process running on the source and destination machines. The reason that rsync will not send deltas when it is the only process is that ...


0

From the DESCRIPTION section of man rsync: Rsync is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the ...


3

man rsync says about --files-from: The filenames that are read from the FILE are all relative to the source dir -- any leading slashes are removed and no ".." references are allowed to go higher than the source dir. So try making the paths output by find relative: rsync -avz ... --files-from=<(ssh user@remote1 'cd /home/admin/Backup/; ...


1

Try authenticating with an ssh key. Any program using ssh for the transfer will automatically find the key and not need a password. Simply run ssh-keygen -t rsa -f ~/.ssh/id_rsa Then append your new ~/.ssh/id_rsa.pub onto the remote side's ~/.ssh/authorized_keys file ssh USER@REMOTE_HOST 'cat >> .ssh/authorized_keys' < ~/.ssh/id_rsa.pub and ...


3

First you may check whether ssh-agent is running and start it if not: if ! [ -n "$SSH_AUTH_SOCK" ] || ! { ssh-add -l &>/dev/null; rc=$?; [ "$rc" -eq 0 ] || [ "$rc" -eq 1 ];}; then echo "Starting agent..." eval "$(ssh-agent -s)" fi ssh-add -l exits with code 1 if there are no identities and with code 2 if it cannot connect to ssh-agent. ...


3

The idea of ssh-agent is to have a running service storing all your keys. Therefore you only need to enter your password once and you can even forward your agent to a remote host if you want to log in to a second host from there. First verify that ssh-agent is running using ssh-add -l, which probably says "The agent has no identities." Second you add keys ...


1

Rsync only refrains from copying a file if it thinks the copy in the destination tree is identical to the copy in the target tree. By default, it assumes that the files are identical if they have the same size and the same modification time. You can pass the option -c to make rsync calculate a checksum instead (which is a lot slower since it has to read the ...


1

Apparently cloudfuse doesn't support setting modification times on existing files (the "not implemented" error). Hence you need to tell rsync not to try it: rsync -a --no-times --ignore-existing /src 1.1.1.1:/target/ The -t you supplied was implied by -a and needs to be turned off, hence --no-times. Also -0 makes no sense as you're not using *from/filter ...


0

Turns out there is a program that permits this, just not the original rsync program. It's called pssh (parallel ssh I suppose) One of the features: "-- Parallel rsync (parallel-rsync, upstream calls it prsync), efficiently copies files to multiple hosts in parallel" - ...


0

From zany's comment to slm's answer (Move files and delete directories with rsync?) I would recommend these 2 commands as an answer: rsync -av --ignore-existing --remove-source-files source/ destination/ && \ find source/ -depth -type d -empty -exec rmdir "{}" \; The advantage is, like zany said, there is still some danger involved in using rm ...


1

Facilitate the --exclude= option. To sync to a depth of 2 (files within folder and subfolders): rsync -r --exclude="/*/*/" source/ target/ It will give you this: target/ ├── subfolder 1 │   └── wanted with depth 2.txt ├── subfolder 2 │   └── wanted with depth 2.txt └── wanted with depth 1.txt To sync to a depth of 3 (files within folder, subfolders ...


1

Try a tar to /dev/null of the directory instead of a defrag... that will definitely not modify the disk, but will get all of the inodes cached. With large directories containing lots of files, ext4 indexes them in a hash tree so readdir() returns them in essentially random order. Trying to stat() them in that same order causes a lot of seeks, making it ...


0

If the old and new filesystems are both accessible to your machine, then consider using a symbolic link instead of rsync. If your rsync command you're using does not specify hosts (or if they are the same host), then this is the case. You're trying to mirror two directories with a different name on the same host. Don't use rsync for this, since you are ...


1

If you want to use rsync to recursively make the dest directory an exact copy of the src directory: rsync -a src/ dest The rsync man page explains how this works: A trailing slash on the source [...] avoid[s] creating an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this ...


0

I find an alternative solution now. Using rysnc -r /origin/* /target/ can sync all the contents from origin directory to target directory.


0

I use the following: sudo rsync -azvv /home/path/folder1/ /home/path/folder2 |& tee rsync.output The file 'rsync.output' will contain your output.


1

To add to Nils's answer (for anyone coming across this via Google), by default rsync only compares the file sizes and modification times to tell if there are any differences. (If those are different it does more, but if they're the same, it stops there.) If you want to compare actual file contents, even for files which have the same size and last ...


1

You are seeing the results of rsync's "quick check" algorithm which decides to transfer files based on their size and their timestamp. As detailed in man rsync: Rsync finds files that need to be transferred using a "quick check" algorithm (by default) that looks for files that have changed in size or in last-modified time. Any changes in the ...


0

FYI: 1) The public key is always in the home directory of the user logging in to remote server i.e. if you login as "backup" it is located at /home/backup/.ssh/authorized_keys. User ID when you login defines the public key used at the destination. You can choose the user ID when making connection by two different ways: ssh user_id@destination.server or ...


2

A hardlink is by definition a link to an inode. Multiple hardlinks to an inode hence do not need additional inodes... The only thing that will increase inode usage is that for each "generation" the directory tree itself will be duplicated, so for each directory in each generation an additional inode will be needed, whether files are changed or not. That ...



Top 50 recent answers are included