The problem is in the set line.  It should read

FN=etc-$(date +%Y-%m-%d)

(No spaces before or after the equal sign).
Also, why the ? after the $FN.tar on the second line?

As for just finding new files, what you probably want is something
along the lines of:

tar -cf $FN.tar $(find /etc -mtime 0 -type f)

(The mtime n means modified within the last n days.. change the number
to suit your taste.  type f just indicates that it should only look at
files, not directories, since tar expands a directory into a recursive
save of that whole directory and everything in it, which is not what you
want.)

So what you end up with is:

FN=etc-$(date +%Y-%m-%d)
tar -cf $FN.tar $(find /etc -mtime 0 -type f)
gzip $FN.tar

Hope this helps.
-Cliff



Cliff Woolley
Central Systems Software Administrator
Washington and Lee University
http://www.wlu.edu/~jwoolley/

Work: (540) 463-8089
Pager: (540) 462-3472

>>> "Miguel G." <[EMAIL PROTECTED]> 08/01/99 10:25AM >>>
could anyone help me with a very simple script? 
(it simply doesn't work the  variables stuff)
and also how can I modify this (tar) to retrive only files which 
I might get as new from $(find ...)

set $FN = etc-$(date +%Y-%m-%d)
tar -cf $FN.tar? /etc/
gzip $FN.tar

Reply via email to