I am writing a script where I'd like to upload individual files and have the folder structure automatically generated like mkdir -p but I can't get rsync 2.6.9 (both) to cooperate.
It looks like rsync is making only one level of folders, otherwise erroring.
I'm trying to reproduce handy ncftpput -C -R -m remote-host local-path-name remote-path-name
actions ( ncftp's Recursive mode; copy whole directory trees + Attempt to make the remote destination directory before copying.).
Possible?
My Attempts:
rsync -av -e ssh /home/gitrepos/www/board/httpdocs/B/C/delete_snippet.processor.php [email protected]:/var/www/vhosts/testboard.org/httpdocs/B/C/delete_snippet.processor.php
returns:
rsync: push_dir#3 "/var/www/vhosts/testboard.org/httpdocs/B/C" failed: No such file or directory (2)
rsync -av -e ssh /home/gitrepos/www/board/httpdocs/B/C/delete_snippet.processor.php [email protected]:/var/www/vhosts/testboard.org/httpdocs/
works, creates httpdocs, but without the B/C structure.
rsync -advR -e ssh -v /home/gitrepos/www/board/httpdocs/B/C/delete_snippet.processor.php [email protected]:/var/www/vhosts/testboard.org/httpdocs/
works but recreates the entire /home/gitrepos... structure on the server.
permissions are set 777 and owned by user.
Thanks for help.
If you're using rsync 2.6.7 or later you can try the dot slash method after the httpdocs for limiting the directories. Try this: