Community discussions

MikroTik App
 
myso
newbie
Topic Author
Posts: 30
Joined: Wed Oct 21, 2009 8:26 pm

Using wildcard (*) in scp command

Wed Dec 17, 2014 5:00 pm

Hi all,

I came across a strange behavior while working on my automated backup-download script.

I use scp to download *.backup and *. rsc files from my routers. On windows with pscp the syntax file.* works fine, but on unix and linux machines I got the following error:
[root@pha /]# scp -i scp_dsa scp@192.168.0.1:/file.rsc ./scp/
file.rsc 100% 34KB 33.6KB/s 00:00
[root@pha /]# scp -i scp_dsa scp@192.168.0.1:/file.backup ./scp/
file.backup 100% 470KB 470.3KB/s 00:00
[root@pha /]# scp -i scp_dsa scp@192.168.0.1:/file.* ./scp/
scp error: /file.*: no such file or directory!
[root@pha /]# scp -i scp_dsa scp@192.168.0.1:/file.\* ./scp/
scp error: /file.*: no such file or directory!
[root@pha /]# scp -i scp_dsa 'scp@192.168.0.1:/file.\*' ./scp/
scp error: /file.*: no such file or directory!
[root@pha /]# scp -i scp_dsa scp@'192.168.0.1:/file.\*' ./scp/
scp error: /file.*: no such file or directory!
[root@pha /]# scp -i scp_dsa "scp@192.168.0.1:/file.*" ./scp/
scp error: /file.*: no such file or directory!
[root@pha /]# scp -i scp_dsa "scp@192.168.0.1:/file.\*" ./scp/
scp error: /file.*: no such file or directory!
But when using the same syntax file.\* between the two unix-like machines everything is ok.

Do I have to use anything special to get this working on the RouterOS platform?

Thanks

Michael
 
User avatar
Virsacer
just joined
Posts: 6
Joined: Sun Jan 08, 2023 5:36 pm
Location: Germany

Re: Using wildcard (*) in scp command

Sun Jan 08, 2023 6:14 pm

Hi,
I would also like to pull both backup-files with a single command.

After trying multiple variations of the command I found this post.
Is there (still) no way to do that?

Who is online

Users browsing this forum: No registered users and 18 guests