Miguel G. wrote:
>
> Hi all!
>
> 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)
<no space><no dollar>FN<no space>=<no space>"etc-$(date +%Y-%m-%d)"
> tar -cf $FN.tar /etc/
> gzip $FN.tar
>
> THANKS A LOT!!!!!
Assuming daily backups:
FN="etc-$(date +%Y-%m-%d).tar.gz"
OLDFN="etc-$(date +%Y-%m-%d -d yesterday).tar.gz"
# if you want to update the archive everyday and still
# save the older archives.
cp $OLDFN $FN
tar ufz $FN /etc
# but you don't want to do that. You want to do
# somthing like
find /etc -cnewer $OLDFN | xargs tar cfz $FN
exit 0
# Marc
--
Marc Mutz <[EMAIL PROTECTED]> http://marc.mutz.com/
University of Bielefeld, Dep. of Mathematics / Dep. of Physics
PGP-keyID's: 0xd46ce9ab (RSA), 0x7ae55b9e (DSS/DH)