Re: scp mp3s


Subject: Re: scp mp3s
From: James Gibson (james@elimstone.2y.net)
Date: Sun Jul 07 2002 - 23:55:35 AKDT


On Sun, 7 Jul 2002, Adam Elkins wrote:
> Is there a way I can retrieve ONLY the files that made it?
> LIke tell it to grab everything over 1Mb in size?

Sure.. Buncha different ways of doing it.. I'd probablly do something like
this though (from the machine that the mp3s are currently on):

find /home/foo/mp3z -iname \*.mp3 -and -size +1024k -exec scp {} \
user@remotehost:/home/user/mp3z \;

But that command assumes that you are using key-pair authentication
between the hosts, otherwise you will be typing in your password a lot[1]
(a Bad ThingTM). Another way, which would lend itself well to the
password-auth scenario would be to move them somewhere else and then scp
'em. like so:

find /home/foo/mp3z -iname \*.mp3 -and -size +1024k -exec mv {} \
./goodmp3s \;
scp ./goodmp3s/* user@remotehost:/home/user/mp3z;

**Note** the backslashes are important.. the '*' and the ';' need to be
passed to 'find', _not_ interpreted by the shell, an the needs to be a
space between the last argument passed to '-exec' and the '\;'.

I was going to write a solution in awk, but I have to go to work in the
morning, so I'll skip it. =)

BTW, anyone who I haven't contacted take note: my e-mail address has
changed. That is all.

--James

[1] - I suppose this could be fixed by prepending 'yes PASSWORD |', but..
but... why bother using 'scp' if you are going to leave your password in
plain-text in your ~/.bash_history??? *grins* 'insecurity 101'...

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Sun Jul 07 2002 - 23:55:52 AKDT