rsync folders with same data but different names?

Status
Not open for further replies.

office politics

It's all just 1s and 0s
Messages
6,555
Location
in the lab
we have a folder named backup and on another server it is named backups. i want to rsync the directories. if i use the command below, i think it will xfer the folder named backup to /server2/backups/backup. how do i change this to copy to the same folder but different name?

rsync -ar /server/backup /server2/backups
 
I'm not a linux pro, but let me pick at this.

If you put /server/backup, doesnt it copy that folder. Where /server/backup/ copies the data in that directory?
 
Ahhh this is slipping my mind but I think MindoverMaster is on to something. The trailing / might be the golden ticket, but a test-drive will be in order to confirm it.
 
i'm a little confused abotu what you're saying, but if i put

rsync -ar /server/backup /server2/backups


it works to sync the folder named backup to /server2/backups. effectively creating /server2/backups/backup. now, the files i need access to are another level deep. i need them up one level.

edit - ok ill give it a go with the slash
 
Using a /* wildcard on the end to grab directory contents instead of a directory can be helpful in your commands to, I haven't used rsync before and the above solutions are probably superior.

This is very true. The * wildcard can be very helpful. I use it more often than I realized. Just be careful with it if you're doing a delete command.

Been there. ;)
 
Status
Not open for further replies.
Back
Top Bottom