By the SCP definition, you need to specify the source path (OK) and destination path (NOT OK). See man page scp
scp ... [user@]host1:]file1 ... [user@]host2:]file2
The other parameters you specified are correct:
-
-r for recursive. This you use to send multiple files within the specified path ("all at once") as long as they are all within the ./ public_html directory (in your example). To send files individually, you need a shell script that lists the files and runs the one-by-one (something by merging find with xargs ).
-
-p to port.
You have even had to specify the destination path. How would the command: (note the : / var / www / ):
scp -p 9922 -r ./public_html [email protected]:/var/www/
Another important detail is permission. The user-ssh user must be writable in the / var / www / directory.
Note: The port can not be at the end of the command, otherwise it is confused with the destination directory.