2

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 [email protected]:/remote/path rsync -az --progress --stats -e ssh /Applications/MAMP/rest/of/path [email protected]:/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..

3
  • 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. Commented Feb 22, 2013 at 13:16
  • there are no weird characters or spaces that would require 'single quotes' or "\" Commented Feb 22, 2013 at 23:43
  • 1
    Are you running this command sshed into the remote server? If so, don't. You have to run the command from your local computer. Commented Mar 12, 2013 at 1:13

1 Answer 1

2

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 . [email protected]:/remote/path 
2
  • 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' Commented Feb 22, 2013 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 Commented Feb 22, 2013 at 23:56

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.