pythonrsync

Using rsync to insert a new subdirectory


I have an existing remote file system like so:

├── freshmeat
│   └── prime
│       ├── A
│       └── B

I want to insert an update from a local directory: freshmeat/prime/c/D So the end result would be:

├── freshmeat
│   └── prime
│       ├── A
│       └── B
|       |___ C
             |- D  

I use rsync -rvzP freshmeat/prime/c/D freshmeat/prime --delete This throws an error that the directory does not exist. Why does it not work?


Solution

  • This post might be helpful, but to summarize you can use the --relative flag (like rsync -a --relative /C/D/ user@remote:/home/username/freshmeat/prime/) where everything part the period will be created.