Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] deleting a local list of filenames from remote server



On 03/12/08 02:52, Charles Muller wrote:

> I have succeeded with this:
> 
>    scp ~/filelist user@example.com:public_html/cache;
> 
>    ssh user@example.com 'cd public_html/cache && xargs rm'  < filelist;
> 
> # then, to delete the contents of the filelist when I am done:
> 
>    cp ~/filelist-null ~/filelist

Since the command you're running on the remote server accepts its input from
stdin, you can do away with the scp altogether. All you're doing here is
copying the file list to the remote server, then piping the local copy into
ssh (i.e. not even using the remote copy).

Also, if your ~/filelist-null file is indeed a null file (zero length) then
you can do ":> ~/filelist" instead, or "cp /dev/null ~/filelist".

-- 
G. Stewart - gstewart@example.com

Microsoft Palladium: "Where the hell do you think YOU'RE going today?"

Attachment: signature.asc
Description: OpenPGP digital signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links