Junos
Highlighted
Junos

I can not "wildcard copy" files from USB drive to MX150 file system

‎09-20-2018 02:55 PM

Hello team:

I want to load many text files at once from my USB drive to a MX150 file system.

 

I followed the hints on KB32657 but the router does not accept my attempt to copy many files at once. Actually KB32657 only explains how to copy a file with its specific name to the router file system, not a bunch of files at once.

 

If I try to copy files with their complete name, as in KB32657, this works.

 

For example:

root@:~ # scp -JU __juniper_private4__ root@192.168.1.1:/var/tmp/usb/lab4.0-LDP-config.txt /var/tmp/

root@192.168.1.1's password: <I ENTER THE ROUTER´s PASSWORD>
lab4.0-LDP-config.txt 100% 20KB 20.1KB/s 00:00
root@:~ #

 

Success! But I need to copy 50 different text files to the router 🐵

 

Since all my files in the USB disk start their names with the "lab" prefix, I attempted to execute the following command, to no avail. See please the following message when I try it:

root@:~ # scp -JU __juniper_private4__ root@192.168.1.1:/var/tmp/usb/lab*.txt /var/tmp/
scp: No match.
root@:~ #

 

¿ Am I missing a sintax requirement? I expected that the "*" character was going to tell the router to copy all the files on my mounted USB drive if the names match "lab*.txt" :o(

 

¿ Any ideas? 

You help will be greatly appreciated.

 

Thanks!!!!

Rogelio Alvez

Argentina

 

 

 

 

4 REPLIES 4
Highlighted
Junos

Re: I can not "wildcard copy" files from USB drive to MX150 file system

‎09-20-2018 04:26 PM

If it doen's even ask for a passowrd I would try enclosing the argument in '':

 

root@:~ # scp -JU __juniper_private4__ 'root@192.168.1.1:/var/tmp/usb/lab*.txt' /var/tmp/

Highlighted
Junos

Re: I can not "wildcard copy" files from USB drive to MX150 file system

‎09-20-2018 04:35 PM

Hello germanbecker!

Thanks a lot for your kind help. I left the office but this is the first thing I will do tomorrow when I come back there. I will let you know as soon as possible.

Best regards!

Highlighted
Junos
Solution
Accepted by topic author ralvez
‎09-21-2018 05:41 AM

Re: I can not "wildcard copy" files from USB drive to MX150 file system

‎09-20-2018 11:21 PM

It's happening as it's your local shell which evaluates the "*" - you need to escape it via the use of backslash. Otherwise the "*" is not used in the remote end of the scp session.

 

Example:

% scp user@10.10.10.224:/var/tmp/* /var/tmp/
scp: No match.
% scp user@10.10.10.224:/var/tmp/\* /var/tmp/
user@10.10.10.224's password:
scp: /var/tmp/gres-tp: not a regular file
scp: /var/tmp/install: not a regular file
/var/tmp//krt_rpf_filter.txt: Permission denied
/var/tmp//pfe_debug_commands: Permission denied
scp: /var/tmp/pics: not a regular file
scp: /var/tmp/rtsdb: not a regular file
scp: /var/tmp/vi.recover: not a regular file

--
Best regards,

Jonas Hauge Klingenberg
Juniper Ambassador & Technology Architect, SEC DATACOM A/S (Denmark)
Highlighted
Junos

Re: I can not "wildcard copy" files from USB drive to MX150 file system

‎09-21-2018 05:43 AM

Thanks! The backslash character did the magic Smiley Very Happy

 

Best regards! And thanks everyone as well.

 

Rogelio

Feedback