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.
root@:~ # scp -JU __juniper_private4__ firstname.lastname@example.org:/var/tmp/usb/lab4.0-LDP-config.txt /var/tmp/
email@example.com'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__ firstname.lastname@example.org:/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.
If it doen's even ask for a passowrd I would try enclosing the argument in '':
root@:~ # scp -JU __juniper_private4__ 'email@example.com:/var/tmp/usb/lab*.txt' /var/tmp/
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.
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.
% scp firstname.lastname@example.org:/var/tmp/* /var/tmp/
scp: No match.
% scp email@example.com:/var/tmp/\* /var/tmp/
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
Thanks! The backslash character did the magic
Best regards! And thanks everyone as well.