venusexmachina Then I attempted it using the default password temppwd or blank but neither of them work.
there is no password for user root
. If you are prompted for one, the username is misspelt.
venusexmachina scp -r ‘root@192.168.7.2:Bela/projects*’ /Users/.../Downloads/BelaBackup
this fails because you are not using real quotes, but something else. Note the ‘
before root
here:
so it actually thought that you were trying to log in as user ‘root
, which doesn't exist.
Now, one step back (before you added the quotes):
venusexmachina Unfortunately this gives:
/Users/.../Downloads/BelaBackup: No such file or directory
/Users/.../Downloads/BelaBackup: No such file or directory
/Users/.../Downloads/BelaBackup: No such file or directory
This would have been with this command:
scp -r root@192.168.7.2:Bela/projects/* /Users/.../Downloads/BelaBackup
First off, I assume you were not literally using ...
, but you had your username in there and that it was correct. An incorrect username (or literally using the ...
) would give you the error you got. I prefer to always use ~
instead of /Users/MYUSERNAME/
, because it's more compact and less prone to errors, it works just the same on systems other than macos and you don't have to hide your username when pasting that command elsewhere. If you did put your username in there and it was correct, the next possible culprit down the list is that the BelaBackup
folder didn't exist. Did you create it before running the scp
command?
Compare these two commands:
#1
scp -r root@192.168.7.2:Bela/projects ~/Downloads/BelaBackup
#2
scp -r root@192.168.7.2:Bela/projects/* ~/Downloads/BelaBackup
Command #1 copies the folder the Bela/projects/
to ~/Downloads/BelaBackup
. As it copies a whole folder, the destination path does not need to exist: if it doesn't exist it will be created.
Command #2, which is the equivalent of what you wrote above assuming you had the right thing in place of ...
, instead copies all the files contained in the Bela/projects
folder to ~/Downloads/BelaBackup
. In this case, you are not copying a single folder, but several files (and/or folders, doesn't matter), so the destination folder BelaBackup
needs to exist beforehand.
One confusing thing about #1 is that it behaves differently depending on whether the destination folder exists or not. If the folder does not exist, you will end up with ~/Downloads/BelaBackup
containing all the project folders:
~/Downloads/BelaBackup/myproject1
~/Downloads/BelaBackup/myproject2
~/Downloads/BelaBackup/myproject3
however if it already exists, you will end up with the Bela/projects
folder being copied into the destination, i.e.:
~/Downloads/BelaBackup/projects/
~/Downloads/BelaBackup/projects/myproject1
~/Downloads/BelaBackup/projects/myproject2
~/Downloads/BelaBackup/projects/myproject3