Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can't seem to transfer a simple local folder to a remote server via SFTP or SSH. I feel like the issue has to do with absolute paths or home directories, but here's what I've tried:

scp -r /Applications/MAMP/rest/of/path user@myserver.com:/remote/path
rsync -az --progress --stats -e ssh /Applications/MAMP/rest/of/path user@myserver.com:/remote/path

All I keep getting is a 'no such file or directory' in reference to the local path.. I dragged n dropped the local folder path into terminal, but while already logged into ssh - would that make any difference? last few hours stuck in a matrix..

share|improve this question
1  
Do you have any "weird" characters in the path name, such as spaces? In that case, they need to be escaped. You could try and write the path via tab completion instead of drag and drop to check if the shell sees it. –  Daniel Andersson Feb 22 '13 at 13:16
    
there are no weird characters or spaces that would require 'single quotes' or "\" –  burtonguster Feb 22 '13 at 23:43
    
Are you running this command sshed into the remote server? If so, don't. You have to run the command from your local computer. –  cpast Mar 12 '13 at 1:13
add comment

1 Answer

scp is plain and simple, if you have rsync, use it, its a lot smarter.

also, drop the -e ssh , as its the default.

i assume you already check the permissions for the correct users in boths sides, so i recommend you first CD the origin directory and run the rsync from there

cd /Applications/MAMP/rest/of/path 
ls -l     # to confirm you are on the right place
rsync -avz --progress --stats  . user@myserver.com:/remote/path
share|improve this answer
    
i tried that and the error message was the same - I'm taking that to mean the local absolute path is not correct once inside ssh.. when I type '~/Applications/MAMP/rest/of/path' I get the ssh path prepending my local like so, '/var/www/web/htdocs/Applications/MAMP/rest/of/path' –  burtonguster Feb 22 '13 at 23:49
    
Lastly, when I do this, $ ssh localhost -t 'exec bash -ilc "exec screen -RD"' I get 'bash: exec: screen: not found Connection to localhost closed' - Why can't I do this simple sftp? arghh –  burtonguster Feb 22 '13 at 23:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.