scp error: not a regular file

8,562

You are missing the -r option that is required to copy a directory and its contents.

From man scp:

-r Recursively copy entire directories.

So your command would be:

sudo scp -r /run/media/orcacomputers/DataCabinet/fileBackups/centos6-root/etc/httpd/conf.d​/ root@ip:/etc/httpd/conf.d​
Share:
8,562

Related videos on Youtube

Powerhouse6666
Author by

Powerhouse6666

Renaissance man polymath Areas of expertise: Auditing, Computer Science, Mixed Martial Arts.

Updated on September 18, 2022

Comments

  • Powerhouse6666
    Powerhouse6666 almost 2 years

    I am trying to copy a directory from my local machine to a remote machine.

    Here is the command I am using;

    sudo scp /run/media/orcacomputers/DataCabinet/fileBackups/centos6-root/etc/httpd/conf.d​/ :root@ip/etc/httpd/conf.d​

    What am I doing wrong here?

  • Powerhouse6666
    Powerhouse6666 over 5 years
    command not found
  • n8te
    n8te over 5 years
    Which command is it saying is not found?
  • Powerhouse6666
    Powerhouse6666 over 5 years
    sudo: /run/media/orcacomputers/DataCabinet/fileBackups/centos6-roo‌​t/etc/httpd/conf.d​/‌​: command not found [orcacomputers@orcainbox conf.d]$ sudo -r scp /run/media/orcacomputers/DataCabinet/fileBackups/centos6-roo‌​t/etc/httpd/conf.d​/ [email protected]:/etc/httpd/conf.d​
  • n8te
    n8te over 5 years
    You wrote sudo -r scp but it should be sudo scp -r
  • n8te
    n8te over 5 years
    That's a whole new problem now. Run it one more time with the additional -v option to see if it gives you more of a clue where it's getting tripped up. Run sudo scp -rv /run/media/orcacomputers/DataCabinet/fileBackups/centos6-roo‌​t/etc/httpd/conf.d​/
  • Powerhouse6666
    Powerhouse6666 over 5 years
    thanks! here is the paste bin pastebin.com/p1XtPR9W
  • n8te
    n8te over 5 years
    There are a number of possible causes to what you're seeing but this is wandering too far off from the original problem: the missing -r option that was preventing a directory from being copied. I would encourage you to start a new post with all the details necessary to troubleshoot this new authentication issue you're seeing. It's too complex to go back and forth here in the comments on this post.
  • Powerhouse6666
    Powerhouse6666 over 5 years
    Okay great, thank you for the clarification. 10-4 Powerhouse 0ut
  • Community
    Community over 2 years
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.