Re: copying files from ls command


Subject: Re: copying files from ls command
From: Justin Dieters (enderak@gci.net)
Date: Wed Jan 14 2004 - 16:27:50 AKST


I'm trying to set it up as an automatic weekly cron job (for automatic backup purposes). There are many gigs of data in the 1999-2003 directories, so time and space prevents me from doing what you suggested. The rest of the directories besides the 1999-2003 directories are current projects, which are added, removed, and renamed on a daily basis, so hard-coding the names in the file is not practical either.

Justin

----- Original Message -----
From: Neil Moomey <neil@neilmoomey.com>
Date: Wednesday, January 14, 2004 4:13 pm
Subject: Re: copying files from ls command

> If you've spent that much time on it why don't you just copy
> everything and
> delete what you don't want.
>
> Neil
> ----- Original Message -----
> From: "Justin Dieters" <enderak@gci.net>
> To: <aklug@aklug.org>
> Sent: Wednesday, January 14, 2004 3:57 PM
> Subject: copying files from ls command
>
>
> >
> > I have been struggling with this for the past hour - hopefully
> someone can
> help me out. I am trying to copy an entire directory, except for
> a few
> selected directories within that directory.
> >
> > I can get a list of the directories I want using
> "ls -I<dir_to_remove_from_list> -I<dir_to_remove_from_list>..."
> >
> > In this particular instance, I want to copy all files in a
> particulardirectory except the directories named "1999 Files",
> "2000 Files", etc.
> There are spaces in some of the directory names, so I have to
> either put
> them in quotes or use escape characters for the spaces.
> >
> > My current attempt is:
> > cp -rfpv `ls --quoting-style=escape -I<...>` /destdir
> >
> > But this results in errors like Cannot stat file 'Blah\\'
> >
> > If I try --quoting-style=c or --quoting-style=shell, I get
> similar errors,
> Cannot stat file '"Blah'
> >
> > How could I get this to work? It's almost like it adds the escape
> character to the \ character, resulting in 'cp' thinking the \ is
> part of
> the file name and not the escape character for the following
> space. A it
> doesn't seem add an escape character to the " character, resulting
> in 'cp'
> thinking that " is part of the file name.
> >
> > Any ideas?
> >
> > Thanks,
> > Justin
> >
> > ---------
> > To unsubscribe, send email to <aklug-request@aklug.org>
> > with 'unsubscribe' in the message body.
> >
>
>

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



This archive was generated by hypermail 2a23 : Wed Jan 14 2004 - 16:27:54 AKST