Using wildcards with scp
I'm sending several files via scp where I specify each filename. My code is:
scp -p missing_name.xlsx missing_address.xlsx username@hostname://dir1/dir2 But I want to add another file, the only problem is the file has a date appended to it everyday.As such: names_missing_12_15_2016.xlsx How can I add this file to the code above using a wildcard? |
names_missing_*.xlsx
|
Specifically it is the shell doing the work before scp gets ahold of the names. The method is called globbing and there is a manual page for it covering the details.
Code:
man 7 glob |
I decided it would probably be best to move the file(s) first, THEN append the current date.
|
Quote:
|
@TenTenths.........actually not. I'm using a 3rd party application(Oracle EDQ) which makes things kinda complicated. EDQ has it's own internal sftp so the files are moved twice anyways.
|
I have abandoned this option because I'm using Expect and it doesn't recognize wildcards
|
I can't help but think that if you were to use SSH (scp / sftp) with keys, you'd be long since done by now. Keys are easy to use.
|
I agree, and I've tried to set it up but after several attempts I gave up on the option. Someone would have to guide me step by step to accomplish it
|
The gist is create the keys and load the public key onto the server:
Code:
cd ~/.ssh/ Code:
scp -i ~/.ssh/yerserver_key.rsa names_missing_*.xlsx trickydba@yerserver.example.com:/some/path/. |
It was actually an issue with permissions that prevented me from transferring files from linux to a windows shared folder. I got with the linux team and they corrected some issues with the GID and UID and now all I hav to do is use the 'mv' command. I appreciate all the help!!
|
All times are GMT -5. The time now is 11:37 PM. |