1
vote
1answer
135 views

Copy directory, but fail if file already exists at destination

cp -a foo/* bar/ will copy the contents of foo into bar, replacing any files that already exist. I can use the -n flag to make cp not overwrite existing files or -i to make it ask interactively ...
0
votes
1answer
48 views

How use `rsync -R` with multiple subdirs or install -D with multiple files?

Is possible with rsync to copy multiple files from a source directory to a dest directory with multiple subdirectories that don't exist? Or use install -D with multiples files to a directory that ...
6
votes
1answer
447 views

preserving extended attributes with cp/rsync

When copying with cp, the extended attributes are not preserved, even with explicit cp -a --preserve=all /source /dest or cp -a --preserve=xattr /source /dest The same is with rsync, i.e. ...
1
vote
2answers
94 views

How can i keep the mtime of files and directories in bash when I use rsync or cp? For use in Backup/Incremental Backup

I have a new NAS box and after looking through numerous backup solutions I've found doing it manually through PuTTy to work the best. After logging in to the box through PuTTy as root, I first need ...
8
votes
3answers
397 views

rsync most recent x GB

I'm looking for a command/script to allow the most recently modified files (up to) 10GB be copied to another computer. So if there are 4 files 4 GB each, only 2 of them should be transferred by the ...
3
votes
5answers
775 views

How can a filesystem be copied exactly as is?

I have a file system for a device I am programming that I would like to make an exact copy of. Ideally I would like this copy to be identical to the folder that it was copied from. I have tried using ...
14
votes
4answers
950 views

Why not always use rsync?

I wanted to ask is there any reason not to use rsync for everything and abandon cp? I wasn't aware of rsync and now I don't know why cp is ever needed.
2
votes
3answers
2k views

`cp -al` snapshot whose hard links get directed to a new file when edited

I am trying to take snapshots of a massive folder regularly. I have read here: http://www.mikerubel.org/computers/rsync_snapshots/#Incremental that cp -al takes a snapshot of a folder by simply ...
7
votes
4answers
4k views

cp or rsync, is cp really worth it?

I hope this does not count as a question without a real answer, as I can't seem to find a good reason to use cp(1) over rsync(1) in virtually all circumstances. Should one typically favour rsync over ...
6
votes
2answers
11k views

Using rsync to move (not copy) files between directories?

I have been using rsync to copy files for some time. My understanding is that rsync is faster than cp when some of the files to transfer are already in the destination directory, transferring only the ...
4
votes
1answer
452 views

Only use mtime comparison with rsync?

Is it possible to sync files via rsync and let rsync only compare mtime informations? Or is there another tool for this job? That means that such a tool only copies src to destination if the src is ...
2
votes
2answers
296 views

How to update a content management installation by overwriting existing files via ssh and shell?

I have installed a cms (modx) on a webserver running CentOS 5 and Apache 2.2. Now there is a new version and I would like to update it. The instructions in the modx-wiki suggest to overwrite the ...