- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to scp mutiple files (using wild chars ? or *)...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2005 06:42 PM
тАО09-30-2005 06:42 PM
I need a help from you guys,
I have backup (backtrack backup) files with names as given below
ssng0011dwk:/tmp$ls -1
datafile_1-0.25-09-2005.23:56:39-18218
datafile_2-0.25-09-2005.23:57:35-18362
datafile_3-0.25-09-2005.23:58:02-18480
datafile_4-0.25-09-2005.23:58:15-18506
datafile_5-0.25-09-2005.23:58:20-18527
I am trying to scp these files from another server as
schi6049ndb:/home/ezhilara$
scp ezhilara@ssng0011dwk:/tmp/datafile_3-0.25-09-2005.23:58:02-18480 .
It is working fine. but it asks password for each scp command
( whereas rcp is not asking for password, but now disabled rcp in our environment )
Suppose we have about 50 backup files, then I have to make 50 scp command for each file
and I have to monitor so closely to check whether current scp is over and is it waiting for password for next scp
It is practically very difficult.
So my requests are
------------------
1)
I want to hardcode my password in a file, and scp should take password from this file instead of waiting to enter password
I tried as below, but it is NOT working
scp ezhilara@ssng0011dwk:/tmp/datafile_3-0.25-09-2005.23:58:02-18480 . < /tmp/pwdfile
2)
I want to use wild characters ? or * to scp multiple files in a single command instead one scp command for each file
I tried as below, but it is NOT working
scp ezhilara@ssng0011dwk:/tmp/datafile_* .
scp ezhilara@ssng0011dwk:/tmp/datafile_[?]-0.25-09-2005.* .
Please reply me
Thanks and regards
Ezhil
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2005 06:51 PM
тАО09-30-2005 06:51 PM
Re: How to scp mutiple files (using wild chars ? or *) in a single scp command
scp ezhilara@ssng0011dwk:/tmp/ .
1) I hope you have not setup ssh commands key sharing properly. You can use temporary file to keep password. SSH is more secured one on handling passwd.
You can use expect scripting to handle passwd like this.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2005 06:53 PM
тАО09-30-2005 06:53 PM
Re: How to scp mutiple files (using wild chars ? or *) in a single scp command
ftp -i -n
user
cd /tmp
lcd /tmp/
mget datafile_*
bye
EOF
You can put it in a script like,
USER="root"
PASSWD="PASSwd123"
ftp -i -n
user $USER $PASSWD
cd /tmp
lcd /tmp/
mget datafile_*
bye
EOF
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2005 06:54 PM
тАО09-30-2005 06:54 PM
Re: How to scp mutiple files (using wild chars ? or *) in a single scp command
If security is not a matter then setup rcp (with available security) and do wild-card file copying.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2005 06:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2005 09:11 PM
тАО10-02-2005 09:11 PM
Re: How to scp mutiple files (using wild chars ? or *) in a single scp command
Regarding the wildcards, try and put "" around the path, like this:
scp ezhilara@ssng0011dwk:"/tmp/datafile_*" .
Regards,
Kasper
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2005 12:04 AM
тАО10-03-2005 12:04 AM
Re: How to scp mutiple files (using wild chars ? or *) in a single scp command
2) If this is something you're doing frequently you might want to explore the open source package, rsync. It is designed for transferring multiple files and more - it will keep directory contents in sync between two servers and there are even flag that will let you have it delete files from the target that are no longer on the source.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2005 03:18 AM
тАО10-03-2005 03:18 AM
Re: How to scp mutiple files (using wild chars ? or *) in a single scp command
What versions of SSH/scp?
What were the errors that you received"?
Wild cards with 'scp' work just fine for me and always have:
hpux <--> hpux
linux <--> hpux
linux ## rm /tmp/x* ; mkdir /tmp/tmp
hpux ## rm /tmp/x* ; mkdir /tmp/tmp
linux ## touch /tmp/xyz
hpux ## touch /tmp/xmm
hpux ## scp -p linux:/tmp/x? /tmp/tmp
scp: /tmp/x?: No such file or directory
hpux ## scp -p linux:/tmp/x?? /tmp/tmp
xyz 00% 0 0.0KB/s 00:00
hpux ## scp -p linux:/tmp/x* /tmp/tmp
xyz 100% 0 0.0KB/s 00:00
linux ## scp -p hpux:/tmp/x? /tmp/tmp
scp: /tmp/x?: No such file or directory
linux ## scp -p hpux:/tmp/x?? /tmp/tmp
xmm 100% 0 0.0KB/s 00:00
linux ## scp -p hpux:/tmp/x* /tmp/tmp
xmm 100% 0 0.0KB/s 00:00
And same results for hpux<-->hpux.
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2005 11:59 AM
тАО10-09-2005 11:59 AM
Re: How to scp mutiple files (using wild chars ? or *) in a single scp command
Dirk Dierickx's suggestion help me for the issue of scp is not supporting wildcard characters.
Now I have logined as my userid and running scp command, it is not asking for password.
(Previous I logined as oracle userid without password, then tried scp using myid, it asked for password for each scp command).
Thanks for all of you.
And my special thanks to Dirk Dierickx.
Regards
Ezhil