Not a regular file scp что
Перейти к содержимому

Not a regular file scp что

  • автор:

scp gives "not a regular file"

I have a problem when using scp on Linux, it says «not a regular file». I looked at other questions/answers about that, but I can’t find out what’s wrong. I wrote:

to copy file.fits from aa@aa , /home/pictures to the current directory. I also tried without using /home/ , but it didn’t work neither.

Do you understand what’s wrong?

8 Answers 8

I just tested this and found at least 3 situations in which scp will return not a regular file :

  1. File is actually a directory
  2. File is a named pipe (a.k.a. FIFO)
  3. File is a device file

Case #1 seems most likely. If you meant to transfer an entire directory structure with scp use the -r option to indicate recursive copy.

«/home/pictures/file.fits» must name an actual filesystem object on the remote server. If it didn’t, scp would have given a different error message.

I see that FITS is an image format. I suppose «/home/pictures/file.fits» is the name of a directory on the remote server, containing FITS files or something like that.

To copy a directory with scp , you have to supply the «-r» flag:

One way this error can occur is if you have a space before the first path like below:

To fix, just take the space out:

By being teaching lots of people of basic sysadmin I must say in 90% cases it is because they are trying to copy directory without passing -r source

Just use -r flag. E.g to copy from remote to local:

Ivan Borshchov's user avatar

simple steps you need to follow

1)scp -r user@host:/var/www/html/projectFolder /var/www/html/localsystem-project-folder

2)scp -r user@host:/var/www/html/projectFolder/filename.php /var/www/html/localsystem-project-folder/

here -r is for recursive traverse the director will help you without any error.

niraj rahi's user avatar

It is possible that you are working with a directory/folder.

If this is the case, here is what you want to do:

First, compress the folder. By running the command:

zip -r name_of_folder.zip name_of_folder

Then use the scp command normally to copy the file to your destination:

scp path/to/name_of_folder.zip server:localhost:/path/to/name_of_folder.zip

Enter your password if it prompts you for one.

Unzip the name_of_folder.zip with this command:

unzip name_of_folder.zip

That is it, you now have your folder in the destination system. By the way, this is for zip compression.

NOTE: If you are on Mac OS and you don’t want to see resource files such as _MACOSX, you may run:

Meaning the above command should be used instead of that in step 1 above.

scp error: not a regular file

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?

powerhousemethod's user avatar

2 Answers 2

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

SFTP get not a regular file – Easy fix for this file transfer error

The answer is quite simple, add the SFTP option flag to transfer non-regular files.

At Bobcares, we get many requests to fix SFTP errors, as a part of our Server Management Services.

Today, let’s have a look into this SFTP error. We will also see how our Support Engineers fix this.

A snapshot on SFTP get and regular file

Before getting into the error, let’s familiarize what is SFTP.

SFTP aka Secure File Transfer Protocol ensures secure data transfer over SSH. Hence this is otherwise known as SSH File Transfer Protocol.

SFTP use get command to transfer remote files to a local system. For transferring regular files, we use a simple get command. But in case of non-regular files, we need to add option flags to the command.

But what are regular and non-regular files in Linux?

Files like text files, images, binary files, etc are regular files. All others are non-regular files. That is directories, symbolic links, etc. So, improper commands can end up in SFTP get errors. Let’s check out the below instance.

How we fix the error SFTP get ‘not a regular file’?

Recently, one of our customers approached us with an SFTP error. Our Support Engineers checked the error. The customer tried the get operation using the command,

And he got the error message,

The reason was clear, the command usage missed an important flag. That is, for transferring non-regular files or directories, we need to add -r flag. Where -r indicates recursive action.

Hence our Support Engineers corrected the code to,

And this fixed the error.

Alternatives to SFTP

SCP allows secure copying of files and directories between remote hosts. It relays on SSH to transfer data. The command to transfer file is,

Similarly, for remote transfer of file, we use rsync. Rsync allows both remote and local file transfers securely.

[Still having trouble in transferring files remotely? – We’ll help you.]

Conclusion

In short, SFTP get not a regular file is an error message which indicates an incomplete command usage. So, either transfer the file recursively or use alternatives like SCP or rsync. Today, we saw how our Support Engineers help customer transfer files remotely.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

Not a regular file scp что

Plus -R recursive is

Intelligent Recommendation

Remote file or folder copy of linux command -scp

When installing and deploying Linux or upgrading a distributed system, it is often necessary to copy files from the current host to other host nodes in the cluster, or copy files from other host nodes.

Windows and Linux remote file transfer command SCP

Linux file list SCP Linux and host transfer files The scp command is used to copy files remotely [[email protected] a]#ls #There are the following files in the a directory1.txt 2.txt 3.txt .

Linux server mobilization file SCP command usage

Basic usage Two Linux servers must pass the file. If the two servers can log in with each other, then the SCP command can be used, and the usage method is as follows. The format of the opposite machin.

Windows and Linux file transfer —scp command

Sometimes you need to pass files in Windows to Linux, or pass the files in Linux to Windows, you can transfer it with XFTP, but you find XFTP can’t be used, or if you don’t install XFTP, use SCP comma.

Linux SCP command and NOHUP SCP

Linux’s SCP command can copy files and directories between Linux hosts; command basic format: scp [optional parameters] file_source file_target 1, copy from local to remote Copy file Copy catalog 2, c.

More Recommendation

Use the scp command to copy the file to the remote server and report «bash: scp: command not found»

When the scp command is executed, the following error is reported. The machine already has the scp command. scp is a tool for secure remote replication provided by openssh. If rpm is installed, in ope.

linux run file command

1. File directory operation 1. Check the current directory pwd 2. View the file ls -a in the directory 3. Display the files in the directory ll in the form of a list 4. Open the directory cd (absolute.

Linux command: scp command

Scp cross-machine remote copy Scp is a shorthand for secure copy. It is used to remotely copy files under Linux. The command similar to this has cp, but cp is only copied locally and cannot be cross-s.

Linux command SCP command

SCP command — remote copy file Grammar format: SCP [parameter] [file] Common parameters: -1 Using SSH Protocol Version 1-2 -2 Using SSH Protocol version 2 -4 use IPv4 -6 Using IPv6 -b runs in batches .

Linux Command -scp Command — Send File / Folder to Other Linux Host

Linux system: CentOS7 The SCP command is used to send a file to another Linux host. format: For example: Send the HOSTS file in the machine ETC directory to the TestScp directory of the 192.168.1.110 .

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *