3
votes
2answers
75 views

How to force overwrite non-empty directories using `mv`

I am wanting to move (not just copy) a group of files/directories to a different directory some of which have name clashes with files/directories in the target directory. My main objective is to move ...
5
votes
3answers
765 views

How do you compare two folders and copy the difference to a third folder?

You've got three folders: folder current, which contains your current files folder old, which contains an older version of the same files folder difference, which is just an empty folder How do ...
1
vote
1answer
132 views

How does rsync patch files when there is a difference in the middle?

I know how rsync works. My doubt is how does rsync patches the parts which are different between source and destination file. After calculating the block which is different, it sends that part to ...
0
votes
1answer
80 views

Get a clean list of files transferred from rsync

I'm trying to get an itemized list of files transferred by rsync. Using the -i and --out-format options, I'm instead ending up with output that looks like this: 3HMP1MO_001.tif 974.68K 100% ...
2
votes
2answers
99 views

How do I only copy files to a destination that exist in the folder from the source, everything else should not be copied

How can I copy files from source to destination, where in all the files existing in destination (with directory structure), only should be copied from the source, overwritten in the destination. Rest ...
1
vote
3answers
87 views

rsync only subdirectories and content

I have a directory that contains a number of files and subdirectories. See below: baseDir bad1 bad2 subDir1 file1 subDir2 file1 I would like to rsync the contents of baseDir without ...
3
votes
1answer
3k views

Move files and delete directories with rsync?

Recently I needed to delete a large number of files (over 1 million) and I read that doing: rsync -av --delete `mktemp -d`/ ~/source && rmdir ~/source Was one of the most optimized ways to ...
1
vote
1answer
221 views

Getting back rsync's deleted files [duplicate]

I accidentally rsync-ed to a server using the delete attribute when I shouldn't have. Is there any chance of getting the data on the server that rsync removed.. back?
0
votes
1answer
70 views

Rsync adding a “?” at the beginning of directories

I currently have many of these commands running in a .sh file that looks like this: rsync -avz -e ssh --rsh='ssh -p1337' --bwlimit=10000 root@DestinationIP:/home/backup /home/localbackup rsync -avz ...
3
votes
4answers
391 views

Most Efficient way to back up/sync large directories over SSH

I'm looking to back up some large directories on a Dedicated Server to another Server on a daily basis using minimal bandwidth RSync looks like its up to the task but I'm unsure of the best command ...
2
votes
1answer
806 views

What do you filter / exclude list when doing backup with rsync? [closed]

I'm trying to build a comprehensive filter / exclude file, to prevent backuping stuff that doesn't make sense do backup, such as temporary / cache data or easily recreatable files. I would appreciate ...
3
votes
1answer
2k views

Asking rsync to create *any* necessary directories

I have the following loop in zsh: for x in my_folders*; do rsync -adrv $x/foo/bar/ /foo2/bar2/new_dir/$x/ done new_dir does not exist before calling rsync, and I would like rsync to create ...
4
votes
3answers
658 views

How can I exclude files by default with rsync?

How can I exclude files by default with rsync? Here is how my normal rsync syntax starts out: rsync --exclude ".ht*" --exclude "error_log" --exclude ".DS*" --exclude "old" ... I've seen a lot of ...
0
votes
1answer
842 views

How to copy files nested in directories that match a pattern?

I'm looking to copy files from subdirectories that match this pattern vendor/plugin/*/tasks/*.rake into a folder lib/tasks I think that this could be done several ways, but wanted to see if a ...