Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script on a remote server that creates a log each day with the date on the name and need to import it to my local machine everyday, but with my script it transfers all the files and I just want the file of the day.

Remote script that generates the file:

day=`date +%Y_%m_%d`


. >> $file

Local script to get the files:

day=`date +%Y_%m_%d`


scp user@remote.ip:$report\/$file /path/of/local/

Today date is 2013_05_23 and this is what i get:

daily_2013_05_22 100%********************************|  1784       00:00

daily_2013_05_23 100%********************************|  1784       00:00

It should return only the file with the 2013_05_23 on the name.

Can anyone help?


share|improve this question

Your script looks ok to me, except for the \/$file.

Why the backslash? Get rid of it:

scp user@remote.ip:$report/$file /path/of/local/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.