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 Tue, Dec 2, 2008 at 21:22, Charles Muller
<cmuller-lst@example.com> wrote:
> I am thinking that I need to do something that is (logically, at least) like
> this:
>
> ssh user@example.com 'xargs rm < filelist public_html/cache/'
>
> I know that this is not close at all, but I have spent the evening reading
> man pages and Googling around for something equivalent, and so far have not
> been able to come up with something close. I assume that what I want to do
> is possible. Is it?

I do this in one of my scripts

scp $delete_list target_user@example.com:~;
ssh -f target_user@example.com "cat ~/$delete_list_file | xargs rm -fv"

works perfectly. You can drop the "-v" I just have this to get back
what I deleted for my notification mail.

-- 
Clemens Schwaighofer
gullevek@example.com / gullevek@example.com
http://www.flickr.com/photos/gullevek/


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links